Fix for windowShouldClose: being called twice.

[#152 state:resolved]

Reviewed by me.
This commit is contained in:
Francisco Tolmasky committed 2008-12-02 18:08:41 -08:00
1 parent a7a4740c60
commit ce696a50f1
2 files changed
+11 -6

No files matched your search

+9 -2
View File
@@ -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];
+2 -4
View File
@@ -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) } );