mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
Fix for windowShouldClose: being called twice.
[#152 state:resolved] Reviewed by me.
This commit is contained in:
1 parent
a7a4740c60
commit
ce696a50f1
2 files changed
+11
-6
No files matched your search
+9
-2
@@ -1335,8 +1335,15 @@ CPTexturedBackgroundWindowMask
|
||||
*/
|
||||
- (void)performClose:(id)aSender
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(windowShouldClose:)] && ![_delegate windowShouldClose:self] ||
|
||||
[self respondsToSelector:@selector(windowShouldClose:)] && ![self windowShouldClose:self])
|
||||
// Only send ONE windowShouldClose: message.
|
||||
if ([_delegate respondsToSelector:@selector(windowShouldClose:)])
|
||||
{
|
||||
if (![_delegate windowShouldClose:self])
|
||||
return;
|
||||
}
|
||||
|
||||
// Only check self is delegate does NOT implement this. This also ensures this when delegate == self (returns true).
|
||||
else if ([self respondsToSelector:@selector(windowShouldClose:)] && ![self windowShouldClose:self])
|
||||
return;
|
||||
|
||||
[self close];
|
||||
|
||||
@@ -52,10 +52,8 @@ function objj_exception_setOutputStream(aStream)
|
||||
OBJJ_EXCEPTION_OUTPUT_STREAM = aStream;
|
||||
}
|
||||
|
||||
#if COMPILER
|
||||
importPackage(java.lang);
|
||||
|
||||
objj_exception_setOutputStream(function (aString) { System.out.println(aString) } );
|
||||
#if RHINO
|
||||
objj_exception_setOutputStream(warning_stream);
|
||||
#elif DEBUG
|
||||
if (window.console && window.console.error)
|
||||
objj_exception_setOutputStream(function (aString) { console.error(aString) } );
|
||||
|
||||
Reference in new issue
Block a user