lukaszb wrote:

Basicly idea is easy from javascript we call "db wrapper" with take function (callback) 
as argument (that function implement xpidl interface with scriptable and function annotations), in 
"db wrapper" component we run thread where real database connection exists and fetch 
data, then we join to main thread and return result by callback (mentioned above). BUT application 
crash after calling callback (now there is now proxies api) and I assume that callback i collected 
by collected by javascript GC. (When all happens only in main thread then all it's ok).

Strangely enough I recently fixed a similar-looking problem in Thunderbird. There the problem was that the callback was being released on the database thread instead of the main thread.

You could of course be extremely careful with your references so that your callback never gets released on the database thread. Alternatively, these classes make it trivial for you: http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsProxyRelease.h#67

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to