Skip to content

Commit

Permalink
Avoid self release for NSWindow, NSWindowController, NSView
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirixplugins/code@206 bdd3870d-6ba2-4b59-8605-1de7af000970
  • Loading branch information
rossetantoine committed Mar 23, 2012
1 parent 213c621 commit f9610c2
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 28 deletions.
8 changes: 6 additions & 2 deletions 64bit/64bit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "64bit" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* 64bit */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -236,7 +240,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
SDKROOT = macosx10.6;
};
name = Debug;
};
Expand All @@ -253,7 +257,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
SDKROOT = macosx10.6;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion BullsEye/BullsEyeController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void) windowWillClose:(NSNotification*)notification
[[NSUserDefaults standardUserDefaults] setValue: [presetsList arrangedObjects] forKey: @"presetsBullsEyeList"];

[[self window] orderOut: self];
[self release];
[self autorelease];
}
}
- (IBAction) refresh: (id) sender
Expand Down
4 changes: 2 additions & 2 deletions CMIR_T2_Fit_Map/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ - (void) closeViewer :(NSNotification*) note
{
NSLog(@"Viewer Window will close.... We have to close!");

[self release];
[self autorelease];
}

if( [note object] == new2DViewer)
Expand All @@ -987,7 +987,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close.... and release his memory...");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
2 changes: 1 addition & 1 deletion CMIV_CTA_TOOLS/CMIVChopperController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ - (void)windowWillClose:(NSNotification *)notification
[originalViewController release];
[originalViewVolumeData release];
[originalViewPixList release];
[self release];
[self autorelease];

}
- (int)reduceTheVolume:(NSArray*)bordersArray:(ViewerController *) vc
Expand Down
2 changes: 1 addition & 1 deletion CMIV_CTA_TOOLS/CMIVContrastPreview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ - (void)windowWillClose:(NSNotification *)notification
if(parentColorData)
[parentColorData release];

[self release];
[self autorelease];
}
-(void) dealloc
{
Expand Down
2 changes: 1 addition & 1 deletion CMIV_CTA_TOOLS/CMIVScissorsController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ - (void)windowWillClose:(NSNotification *)notification
[centerlinesLengthArrays release];
[seedToolTipsTabView setDelegate:nil];

[self release];
[self autorelease];

}
-(void) dealloc
Expand Down
2 changes: 1 addition & 1 deletion CMIV_CTA_TOOLS/CMIVVRcontroller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ - (void)windowWillClose:(NSNotification *)notification
[originalViewController release];
[originalViewVolumeData release];
[originalViewPixList release];
[self release];
[self autorelease];

}
}
Expand Down
2 changes: 1 addition & 1 deletion CSB_Multi_Fusion/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"CSB_Multi_Fusion: Window will close.... and release his memory...");

[self release];
[self autorelease];

}

Expand Down
2 changes: 1 addition & 1 deletion CardiacStatistics/SectorManagerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ - (void)windowWillClose:(NSNotification *)notification

NSLog( @"ROIManager windowWillClose");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
2 changes: 1 addition & 1 deletion Coronary/CoronaryController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void) windowWillClose:(NSNotification*)notification
[[NSUserDefaults standardUserDefaults] setValue: [presetsList arrangedObjects] forKey: @"presetsCoronaryList"];

[[self window] orderOut: self];
[self release];
[self autorelease];
}
}
- (IBAction) refresh: (id) sender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ -(id)initWithWorkflow:(EjectionFractionWorkflow*)workflow {
-(void)windowWillClose:(NSNotification*)notification {
// NSLog(@"results windowWillClose, rc = %d, win rc = %d", [self retainCount], [[self window] retainCount]);
NSLog(@"results controller window will close, my rc is %d", [self retainCount]);
[self release]; // TODO: this is UNSAFE, [NSWindow dealloc] should release the controller? the problem is, NSWindow's retain count is huge, so it won't be released
[self autorelease]; // TODO: this is UNSAFE, [NSWindow dealloc] should release the controller? the problem is, NSWindow's retain count is huge, so it won't be released
}

-(void)dealloc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ -(NSString*)windowFrameAutosaveName {
#pragma mark Windows

- (void)windowWillClose:(NSNotification *)aNotification { // this window is closing
[self release];
[self autorelease];
}

- (void)viewerWillClose:(NSNotification*)notification {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ -(NSString*)windowFrameAutosaveName {
}

-(void)windowWillClose:(NSNotification *)aNotification {
// [self release];
// [self autorelease];
}

//-(NSSize)windowWillResize:(NSWindow*)window toSize:(NSSize)size {
Expand Down
2 changes: 1 addition & 1 deletion Invert - WindowController/ThanksController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close.... and release his memory...");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
2 changes: 1 addition & 1 deletion MIRC Teaching File/SGAudioSettings.mm
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ - (id)initWithSGChan:(SGAudio *)wrapper

if (!wrapper)
{
[self release];
[self autorelease];
self = nil;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion OpenGL/OpenGLController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close.... and release his memory...");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
4 changes: 2 additions & 2 deletions PetSpectFusion/PSFSettingsWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ - (void)windowWillClose:(NSNotification *)notification
{
DebugLog(@"SettingsWindowController close");
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self release];
[self autorelease];

}

- (void) viewerWillClose:(NSNotification*)notification
{
DebugLog(@"One of the necessary viewers have closed");
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self release];
[self autorelease];
}

- (void) levelChanged:(RegUpdate*) updateParams
Expand Down
2 changes: 1 addition & 1 deletion ROI Enhancement II/Sources/RoiEnhancementInterface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ -(void)windowWillClose:(NSNotification*)notification {
if ([notification object] == [self window]) {
_chart.stopDraw = YES;
[[self window] orderOut: self];
[self release];
[self autorelease];
}
}

Expand Down
4 changes: 2 additions & 2 deletions T1 Fit Map/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ - (void) closeViewer :(NSNotification*) note
{
NSLog(@"Viewer Window will close.... We have to close!");

[self release];
[self autorelease];
}

if( [note object] == new2DViewer)
Expand All @@ -494,7 +494,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close.... and release his memory...");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
4 changes: 2 additions & 2 deletions T2 Fit Map/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ - (void) closeViewer :(NSNotification*) note
{
NSLog(@"Viewer Window will close.... We have to close!");

[self release];
[self autorelease];
}

if( [note object] == new2DViewer)
Expand All @@ -566,7 +566,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close.... and release his memory...");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
2 changes: 1 addition & 1 deletion T2 Ratio Map/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ - (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close.... and release his memory...");

[self release];
[self autorelease];
}

- (void) dealloc
Expand Down
4 changes: 2 additions & 2 deletions Volume Calculator/ControllerVolumeCalculator.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ - (void) closeViewer :(NSNotification*) note
if( [note object] == [filter viewerController])
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self release];
[self autorelease];
}
}

- (void)windowWillClose:(NSNotification *)notification
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self release];
[self autorelease];
}

- (void) dealloc
Expand Down

0 comments on commit f9610c2

Please sign in to comment.