From: Braden M. <br...@us...> - 2006-05-15 04:44:10
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21286/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Remove the request channel (input) watch when destroying the plug-in instance; otherwise we get a stray call to the watch callback and an (apparently spurious) assertion in glib. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** openvrml.cpp 29 Jan 2006 07:00:59 -0000 1.29 --- openvrml.cpp 15 May 2006 04:44:07 -0000 1.30 *************** *** 66,69 **** --- 66,70 ---- GIOChannel * command_channel; GIOChannel * request_channel; + guint request_channel_watch_id; std::stringstream request_line; nsCOMPtr<VrmlBrowser> scriptablePeer; *************** *** 996,999 **** --- 997,1001 ---- command_channel(0), request_channel(0), + request_channel_watch_id(0), scriptablePeer(new ScriptablePeer(*this)) {} *************** *** 1001,1004 **** --- 1003,1012 ---- PluginInstance::~PluginInstance() throw () { + if (this->request_channel_watch_id) { + const gboolean succeeded = + g_source_remove(this->request_channel_watch_id); + g_assert(succeeded); + } + if (this->request_channel) { GError * error = 0; *************** *** 1140,1147 **** this->request_channel = g_io_channel_unix_new(standard_output); if (!this->command_channel) { throw std::bad_alloc(); } ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } --- 1148,1156 ---- this->request_channel = g_io_channel_unix_new(standard_output); if (!this->command_channel) { throw std::bad_alloc(); } ! this->request_channel_watch_id = ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } |