Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: src/views/mac/SkSampleNSView.mm

Issue 633923002: explicitly delete our c++ window on quit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/views/mac/SkNSView.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #import "SkSampleNSView.h" 9 #import "SkSampleNSView.h"
10 #include "SampleApp.h" 10 #include "SampleApp.h"
11 #include <crt_externs.h> 11 #include <crt_externs.h>
12 @implementation SkSampleNSView 12 @implementation SkSampleNSView
13 13
14 - (id)initWithDefaults { 14 - (id)initWithDefaults {
15 if ((self = [super initWithDefaults])) { 15 if ((self = [super initWithDefaults])) {
16 fWind = new SampleWindow(self, *_NSGetArgc(), *_NSGetArgv(), NULL); 16 fWind = new SampleWindow(self, *_NSGetArgc(), *_NSGetArgv(), NULL);
17 } 17 }
18 return self; 18 return self;
19 } 19 }
20 20
21 - (void)dealloc {
22 delete fWind;
23 [super dealloc];
24 }
25
26 - (void)swipeWithEvent:(NSEvent *)event { 21 - (void)swipeWithEvent:(NSEvent *)event {
27 CGFloat x = [event deltaX]; 22 CGFloat x = [event deltaX];
28 if (x < 0) 23 if (x < 0)
29 ((SampleWindow*)fWind)->previousSample(); 24 ((SampleWindow*)fWind)->previousSample();
30 else if (x > 0) 25 else if (x > 0)
31 ((SampleWindow*)fWind)->nextSample(); 26 ((SampleWindow*)fWind)->nextSample();
32 else 27 else
33 ((SampleWindow*)fWind)->showOverview(); 28 ((SampleWindow*)fWind)->showOverview();
34 } 29 }
35 30
36 @end 31 @end
OLDNEW
« no previous file with comments | « src/views/mac/SkNSView.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698