explicitly delete our c++ window on quit

BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/633923002
This commit is contained in:
reed 2014-10-07 06:42:09 -07:00 committed by Commit bot
parent ebfce4149e
commit d3ce6b44e5
4 changed files with 10 additions and 6 deletions

View File

@ -18,6 +18,7 @@
}
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
[fView freeNativeWind];
application_term();
return NSTerminateNow;
}

View File

@ -49,4 +49,7 @@ class SkEvent;
- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType withMSAASampleCount:(int) sampleCount andGetInfo:(SkOSWindow::AttachmentInfo*) info;
- (void)detach;
- (void)present;
- (void)freeNativeWind;
@end

View File

@ -118,12 +118,17 @@ SK_COMPILE_ASSERT(SK_SUPPORT_GPU, not_implemented_for_non_gpu_build);
}
- (void)dealloc {
delete fWind;
[self freeNativeWind];
self.fGLContext = nil;
self.fTitle = nil;
[super dealloc];
}
- (void)freeNativeWind {
delete fWind;
fWind = nil;
}
////////////////////////////////////////////////////////////////////////////////
- (void)drawSkia {

View File

@ -18,11 +18,6 @@
return self;
}
- (void)dealloc {
delete fWind;
[super dealloc];
}
- (void)swipeWithEvent:(NSEvent *)event {
CGFloat x = [event deltaX];
if (x < 0)