a=edburns

r=ashuk
bugs: 44327, 44328

WindowControl:

Don't call nativeDestroyInitContext

NativeEventThread

Call windowControl.nativeDestroyInitContext when the run()
loop exits.


git-svn-id: svn://10.0.0.236/trunk@73825 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2000-07-07 18:49:09 +00:00
parent d54e7976c1
commit 472deb45c4
2 changed files with 20 additions and 3 deletions

View File

@@ -142,6 +142,15 @@ public void delete()
synchronized(this) {
// this has to be inside the synchronized block!
browserControlCanvas = null;
synchronized (this) {
try {
wait();
}
catch (Exception e) {
System.out.println("NativeEventThread.delete: interrupted while waiting\n\t for NativeEventThread to notify() after destruction of initContext: " + e +
" " + e.getMessage());
}
}
}
// PENDING(ashuk): do any necessary cleanup.
listenersToAdd = null;
@@ -199,6 +208,15 @@ public void run()
// this has to be inside the synchronized block!
if (null == this.browserControlCanvas) {
// if we get here, this Thread is terminating, destroy
// the initContext and notify the WindowControl
((WindowControlImpl)windowControl).nativeDestroyInitContext(nativeWebShell);
try {
notify();
}
catch (Exception e) {
System.out.println("NativeEventThread.run: Exception: trying to send notify() to this during delete: " + e + " " + e.getMessage());
}
return;
}

View File

@@ -65,7 +65,7 @@ public WindowControlImpl(WrapperFactory yourFactory,
/**
* First, we delete our eventThread, which causes the eventThread to
* stop running. Then we call nativeDestroyInitContext(), which
* stop running, which causes the initContext to be deleted.
* deallocates native resources for this window.
*/
@@ -75,7 +75,6 @@ public void delete()
Assert.assert(null != eventThread, "eventThread shouldn't be null at delete time");
eventThread.delete();
eventThread = null;
nativeDestroyInitContext(nativeWebShell);
nativeWebShell = -1;
}
@@ -243,7 +242,7 @@ public static void main(String [] args)
Log.setApplicationName("WindowControlImpl");
Log.setApplicationVersion("0.0");
Log.setApplicationVersionDate("$Id: WindowControlImpl.java,v 1.4 2000-03-13 18:42:31 edburns%acm.org Exp $");
Log.setApplicationVersionDate("$Id: WindowControlImpl.java,v 1.5 2000-07-07 18:49:08 edburns%acm.org Exp $");
try {
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);