Skip to content

Commit 429a2d0

Browse files
JezzJezz
authored andcommitted
fix observer bug jezzmemo#68
1 parent 232af94 commit 429a2d0

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

JJException.xcodeproj/xcuserdata/jezz.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
ignoreCount = "0"
2929
continueAfterRunningActions = "No"
3030
filePath = "JJException/ViewController.m"
31-
timestampString = "581006976.523271"
31+
timestampString = "584812300.268707"
3232
startingColumnNumber = "9223372036854775807"
3333
endingColumnNumber = "9223372036854775807"
3434
startingLineNumber = "73"

JJException/Source/MRC/NSObject+KVOCrash.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ - (void)hookRemoveObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath{
292292
return;
293293
}
294294

295+
/*
296+
* Fix observer associated bug,disconnect the self and observer,
297+
* bug link:https://github.com/jezzmemo/JJException/issues/68
298+
*/
299+
objc_setAssociatedObject(observer, &ObserverDeallocKVOKey, nil, OBJC_ASSOCIATION_RETAIN);
300+
295301
KVOObjectItem* item = [[KVOObjectItem alloc] init];
296302
item.observer = observer;
297303
item.keyPath = keyPath;

0 commit comments

Comments
 (0)