You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I always receive this kind of message in console when trying to create class mock and mock class method: objc_disposeClassPair: class 'Mockup-0x10f9de260-116683599' still has subclasses, including 'Mockup_Mockup_'!
Error appears after objc_disposeClassPair call in this method of OCClassMockObject.m:
- (void)stopMocking
{
if(originalMetaClass != nil)
{
/* The mocked class has the meta class of a dynamically created subclass as its meta class,
but we need a reference to the subclass to dispose it. Asking the meta class for its
class name returns the actual class name, which we can then use to look up the class...
*/
const char *createdSubclassName = object_getClassName(mockedClass);
Class createdSubclass = objc_lookUpClass(createdSubclassName);
[self restoreMetaClass];
objc_disposeClassPair(createdSubclass);
}
[super stopMocking];
}
The text was updated successfully, but these errors were encountered:
Let's see what happens with #285. If we end up using a cache in all cases, then this problem would disappear, because we'd never dispose the subclasses.
With iOS 9.3 the slowness problems reported in #253 have disappeared. Therefore, the workaround for these issues proposed in #285 isn't necessary anymore. That in turn means that we should look at this issue again, even though it seems mostly cosmetic.
Could you provide more details, or maybe even a self-contained example that shows the behaviour you are describing. Personally, I have not seen it. Are you using other libraries/frameworks that may impact retention of objects?
I always receive this kind of message in console when trying to create class mock and mock class method:
objc_disposeClassPair: class 'Mockup-0x10f9de260-116683599' still has subclasses, including 'Mockup_Mockup_'!
Error appears after objc_disposeClassPair call in this method of OCClassMockObject.m:
The text was updated successfully, but these errors were encountered: