Giter VIP home page Giter VIP logo

Comments (6)

WayneWeiZhang avatar WayneWeiZhang commented on August 24, 2024

@lzyy dealloc is disabled in aspect_isSelectorHookAllowed method. And as to commit logs, this is due to "workaround #2."

from aspects.

limboy avatar limboy commented on August 24, 2024

@WayneWeiZhang where is aspect_isSelectorHookAllowed defined? and if the super problem solved, dealloc can be used?

from aspects.

WayneWeiZhang avatar WayneWeiZhang commented on August 24, 2024

@lzyy Do you have updated your code?

static NSString *const AspectsHasParentToken = @"AspectsHasParentToken";
static BOOL aspect_isSelectorHookAllowed(Class class, SEL selector) {
static NSSet *disallowedSelectorList;
static NSMutableDictionary *swizzledClassesDict;
static dispatch_once_t pred;
dispatch_once(&pred, ^{
swizzledClassesDict = [NSMutableDictionary new];
disallowedSelectorList = [NSSet setWithObjects:@"retain", @"release", @"autorelease", @"dealloc", @"forwardInvocation:", nil];
});

from aspects.

limboy avatar limboy commented on August 24, 2024

@WayneWeiZhang ha, was looking at the pod version, now see it.

so the reason there is a disallowedSelectorList is because these selectors are managed by ARC, and a bit "magical"?

from aspects.

WayneWeiZhang avatar WayneWeiZhang commented on August 24, 2024

@lzyy Nope, I think the reason is "Infinite Loop when overriding a method at two points which includes a call to super #2"

from aspects.

steipete avatar steipete commented on August 24, 2024

Hooking into dealloc is quite a delicate matter. You can't retain the object, and the message forwarding process really isn't suited for that. Also the only usable position would be AspectPositionBefore. It might be possible to add special code paths to work around this, but it wasn't my priority so far. (Blocking is not really related to #2, that was just a coincidence)

from aspects.

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.