Git Product home page Git Product logo

Comments (5)

larsacus avatar larsacus commented on June 27, 2024

There is already functionality built into LARSAdController to support delayed deallocing of adapter instances. It appears that the adapter is returning YES from -canDestroyAdBanner Since the only requirement from that method is that isBannerViewActionInProgress returns NO. -canDestroyAdBanner looks like the best place to add more logic for delayed destruction.

from larsadcontroller.

dan55304 avatar dan55304 commented on June 27, 2024

@larsacus, thanks for the reply. How would that stop [self.adapterInstances removeAllObjects] from just clearing all the adapters?

from larsadcontroller.

larsacus avatar larsacus commented on June 27, 2024

What is the actual bug being encountered? I assume you're calling destroyAllAdBanners for a reason.

from larsadcontroller.

dan55304 avatar dan55304 commented on June 27, 2024

The error is the title of this report. I call destroyAllAdBanners when an ad-free purchase is made. Unfortunately, it it appears the method is destroying the adapters before getting a chance to turn off notifications. My changes seem to be working.

from larsadcontroller.

larsacus avatar larsacus commented on June 27, 2024

I apologize, the title was truncated in my email, and I didn't look at it again when I came here.

The solution is actually much simpler than that:

- (void)destroyAllAdBanners{
    NSArray *instances = [self.adapterInstances allValues];

    for (id <TOLAdAdapter> adapterInstance in instances) {
        if (adapterInstance.adVisible) {
            [self animateBannerForAdapterHidden:adapterInstance withCompletion:^{
                [self cleanUpAdAdapter:adapterInstance];
            }];
        }
        else{
            [self cleanUpAdAdapter:adapterInstance];
        }
    }
}

-cleanUpAdAdapter: will handle everything needed to remove that instance from its storage arrays and remove all observers. I've updated master with this change.

from larsadcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.