Commit 3dfede2e authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed race conditional crashes in PXSourceList (close #7171)

Trust the ObjC runtime, it will do its job properly.
(cherry picked from commit 50329a43138159395ad0e67f44a7a0c2815546f3)
parent 9855165f
...@@ -71,10 +71,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe ...@@ -71,10 +71,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)dealloc - (void)dealloc
{ {
//Remove ourselves as the delegate and data source to be safe
[super setDataSource:nil];
[super setDelegate:nil];
//Unregister the delegate from receiving notifications //Unregister the delegate from receiving notifications
[[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self]; [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
...@@ -83,10 +79,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe ...@@ -83,10 +79,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)finalize - (void)finalize
{ {
//Remove ourselves as the delegate and data source to be safe
[super setDataSource:nil];
[super setDelegate:nil];
//Unregister the delegate from receiving notifications //Unregister the delegate from receiving notifications
[[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self]; [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
...@@ -117,6 +109,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe ...@@ -117,6 +109,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
{ {
_secondaryDataSource = aDataSource; _secondaryDataSource = aDataSource;
if ([self respondsToSelector:@selector(reloadData)])
[self reloadData]; [self reloadData];
} }
...@@ -138,6 +131,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe ...@@ -138,6 +131,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)reloadData - (void)reloadData
{ {
if ([super respondsToSelector:@selector(reloadData)])
[super reloadData]; [super reloadData];
//Expand items that are displayed as always expanded //Expand items that are displayed as always expanded
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment