We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Homepage: http://cappuccino.org
Clone URL: git://github.com/280north/cappuccino.git
Fix for windowShouldClose: being called twice.

[#152 state:resolved]

Reviewed by me.
Francisco Tolmasky (author)
Tue Dec 02 18:08:41 -0800 2008
commit  ce696a50f14747b6f18af732e0950c05c2ae84fe
tree    c59e1cdab0747a1cf78b7356c739eeb6353c3309
parent  a7a4740c600b4be8aa3e4b2b69397ba6d5e5d8e8
...
1335
1336
1337
1338
1339
 
 
 
 
 
 
 
 
 
1340
1341
1342
...
1335
1336
1337
 
 
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
0
@@ -1335,8 +1335,15 @@ CPTexturedBackgroundWindowMask
0
 */
0
 - (void)performClose:(id)aSender
0
 {
0
- if ([_delegate respondsToSelector:@selector(windowShouldClose:)] && ![_delegate windowShouldClose:self] ||
0
- [self respondsToSelector:@selector(windowShouldClose:)] && ![self windowShouldClose:self])
0
+ // Only send ONE windowShouldClose: message.
0
+ if ([_delegate respondsToSelector:@selector(windowShouldClose:)])
0
+ {
0
+ if (![_delegate windowShouldClose:self])
0
+ return;
0
+ }
0
+
0
+ // Only check self is delegate does NOT implement this. This also ensures this when delegate == self (returns true).
0
+ else if ([self respondsToSelector:@selector(windowShouldClose:)] && ![self windowShouldClose:self])
0
         return;
0
     
0
     [self close];
...
52
53
54
55
56
57
58
 
 
59
60
61
...
52
53
54
 
 
 
 
55
56
57
58
59
0
@@ -52,10 +52,8 @@ function objj_exception_setOutputStream(aStream)
0
     OBJJ_EXCEPTION_OUTPUT_STREAM = aStream;
0
 }
0
 
0
-#if COMPILER
0
-importPackage(java.lang);
0
-
0
-objj_exception_setOutputStream(function (aString) { System.out.println(aString) } );
0
+#if RHINO
0
+objj_exception_setOutputStream(warning_stream);
0
 #elif DEBUG
0
 if (window.console && window.console.error)
0
     objj_exception_setOutputStream(function (aString) { console.error(aString) } );

Comments

    No one has commented yet.