[MacRuby-devel] WebView History / Exception handling

Brad Wilson brad at lucky-dip.net
Mon Oct 20 22:59:17 PDT 2008


Hi,

I'm trying to do a little web browser in MacRuby. It's coming along  
nicely, but I'm having a strange problem with history.
I set up a WebView and it loads, I go to a few urls, then call the  
back action on the WebView.

The first time I do this, I get the error below and get dumped to gdb.
Terminating app due to uncaught exception 'WebKitThreadingException',  
reason: 'void -[WebHistoryItem finalize](WebHistoryItem*,  
objc_selector*) was called from a secondary thread'

If I type quit in gdb, it detaches from the debugger and continues.  
 From that point I can call goBack and goForward and they work fine.


Now I guess I've got two ways out of this:
1. Figure out why WebHistoryItem.finalize is being called from another  
thread, or
2. Add some kind of exception handling to catch this error and ignore  
it.

I haven't really had any luck with 1, so I tried 2 (using http://www.macdevcenter.com/pub/a/mac/2007/07/31/understanding-exceptions-and-handlers-in-cocoa.html?page=7) 
  but I couldn't get it working in MacRuby.

Can anybody point me to a way to catch uncaught exceptions in a  
MacRuby program?

Thanks,
Brad



More information about the MacRuby-devel mailing list