gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r12088: Make sure the GIOChannel isn


From: Bastiaan Jacques
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12088: Make sure the GIOChannel isn't destroyed twice (replace a hack to that
Date: Sat, 20 Mar 2010 22:28:31 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12088
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Sat 2010-03-20 22:28:31 +0100
message:
  Make sure the GIOChannel isn't destroyed twice (replace a hack to that
  effect). Whitespace fixes.
modified:
  plugin/npapi/plugin.cpp
  plugin/npapi/plugin.h
=== modified file 'plugin/npapi/plugin.cpp'
--- a/plugin/npapi/plugin.cpp   2010-03-20 20:33:47 +0000
+++ b/plugin/npapi/plugin.cpp   2010-03-20 21:28:31 +0000
@@ -352,7 +352,6 @@
     _width(0),
     _height(0),
     _streamfd(-1),
-    _ichan(0),
     _ichanWatchId(0),
     _controlfd(-1),
     _childpid(0),
@@ -386,15 +385,6 @@
 {
     logDebug("plugin instance destruction");
 
-    if (_ichan) {
-        logDebug("shutting down input chan");
-
-        GError *error = NULL;
-        g_io_channel_shutdown (_ichan, TRUE, &error);
-        g_io_channel_unref (_ichan);
-        _ichan = 0;
-    }
-
     if ( _ichanWatchId ) {
         g_source_remove(_ichanWatchId);
         _ichanWatchId = 0;
@@ -620,7 +610,6 @@
         // Returning false here will cause the "watch" to be removed. This 
watch
         // is the only reference held to the GIOChannel, so it will be
         // destroyed. We must make sure we don't attempt to destroy it again.
-        _ichan = 0;
         _ichanWatchId = 0;
         return false;
     }
@@ -823,7 +812,8 @@
 }
 
 void
-create_standalone_launcher(const std::string& page_url, const std::string& 
swf_url, const std::map<std::string, std::string>& params)
+create_standalone_launcher(const std::string& page_url, const std::string& 
swf_url,
+                           const std::map<std::string, std::string>& params)
 {
 #ifdef CREATE_STANDALONE_GNASH_LAUNCHER
     if (!createSaLauncher) {
@@ -929,8 +919,8 @@
             continue;
         }
         if (close(anfd) < 0) {
-           numfailed++;
-       } else {
+            numfailed++;
+        } else {
             numfailed = 0;
             closed++;
         }
@@ -1045,12 +1035,12 @@
                                 << std::endl;
 #endif
 
-        _ichan = g_io_channel_unix_new(c2p_pipe[0]);
-        g_io_channel_set_close_on_unref(_ichan, true);
-        _ichanWatchId = g_io_add_watch(_ichan, 
+        GIOChannel* ichan = g_io_channel_unix_new(c2p_pipe[0]);
+        g_io_channel_set_close_on_unref(ichan, true);
+        _ichanWatchId = g_io_add_watch(ichan, 
                 (GIOCondition)(G_IO_IN|G_IO_HUP), 
                 (GIOFunc)handlePlayerRequestsWrapper, this);
-        //g_io_channel_unref(_ichan); // we'll unref on destruction
+        g_io_channel_unref(ichan);
         return;
     }
 

=== modified file 'plugin/npapi/plugin.h'
--- a/plugin/npapi/plugin.h     2010-03-19 19:22:45 +0000
+++ b/plugin/npapi/plugin.h     2010-03-20 21:28:31 +0000
@@ -111,7 +111,6 @@
     unsigned int                       _height;
     std::map<std::string, std::string> _options;
     int                                _streamfd;
-    GIOChannel*                        _ichan;
     int                                _ichanWatchId;
     int                                _controlfd;
     pid_t                              _childpid;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]