I have a XULRunner app that needs a background thread functioning as a job queue. I found [1] and have integrated Steve's AsynchEventQueue (sic) into my app. It works flawlessly in OS X but crashes and core-dumps in Windows. I have isolated the line that causes the problem below.
[1] http://skrul.com/blog/projects/threaddemo this.proxy = this.pom.getProxyForObject(this.eq, Ci.tdIAsynchService, this, Ci.nsIProxyObjectManager.INVOKE_ASYNC); Here are a few preceding lines to give context: const Cc = Components.classes const Ci = Components.interfaces //... start: function(callback) { this.pom = Cc["@mozilla.org/xpcomproxy;1"].getService( Ci.nsIProxyObjectManager); this.eqs = Cc["@mozilla.org/event-queue-service;1"].getService( Ci.nsIEventQueueService); this.callback = this.pom.getProxyForObject( this.eqs.getSpecialEventQueue(Ci.UI_THREAD_EVENT_QUEUE), Ci.tdICallback, callback, Ci.nsIProxyObjectManager.INVOKE_ASYNC); this.thread = Cc["@mozilla.org/thread;1"].createInstance( Ci.nsIThread); this.thread.init(this, 0, Ci.nsIThread.PRIORITY_NORMAL, Ci.nsIThread.SCOPE_GLOBAL, Ci.nsIThread.STATE_UNJOINABLE); var mainThread = Cc["@mozilla.org/thread;1"].createInstance( Ci.nsIThread).currentThread; var i = 0; while(!this.eq && i < 10) mainThread.sleep(10); if(!this.eq) throw Error("Event queue not found"); this.proxy = this.pom.getProxyForObject(this.eq, Ci.tdIAsynchService, this, Ci.nsIProxyObjectManager.INVOKE_ASYNC); return this.proxy; }, //... I've checked that this.pom is created and has the function getProxyForObject, that this.eq gets created properly, and that the interfaces tdIAsynchService and nsIProxyObjectManager exist. I have run the app under XULRunner 1.8.1.3 and 1.8.0.4, with both causing the same crash and core dump. This smells like a bug in the Win32 version of XULRunner, but I don't know how to dig deeper into this problem. Suggestions? Thanks for any help you can provide, Richard [EMAIL PROTECTED] _______________________________________________ dev-tech-xpcom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-xpcom
