mail[Wesnoth-commits] r44167 - /trunk/src/network_ana.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by billybiset on July 15, 2010 - 02:11:
Author: billynux
Date: Thu Jul 15 02:11:42 2010
New Revision: 44167

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44167&view=rev
Log:
Fixes a bug in ana due to upload_log creating a manager object for no other 
reason than to signal network usage.

Modified:
    trunk/src/network_ana.cpp

Modified: trunk/src/network_ana.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network_ana.cpp?rev=44167&r1=44166&r2=44167&view=diff
==============================================================================
--- trunk/src/network_ana.cpp (original)
+++ trunk/src/network_ana.cpp Thu Jul 15 02:11:42 2010
@@ -69,6 +69,8 @@
     ana_network_manager        ana_manager;
     network::bandwidth_in_ptr  global_bandwidth_in_ptr( new 
network::bandwidth_in(4) );
     //TODO: no global bandwidth
+
+    size_t instances_using_the_network_module( 0 );
 }
 
 namespace {
@@ -179,14 +181,16 @@
 
     manager::manager(size_t /*min_threads*/, size_t /*max_threads*/) : 
free_(true)
     {
+        ++instances_using_the_network_module;
         std::cout << "DEBUG: Creating a manager object.\n";
     }
 
     manager::~manager()
     {
-    //     throw std::runtime_error("TODO:Not implemented");
         std::cout << "DEBUG: destroying the manager object.\n";
-        ana_manager.close_connections_and_cleanup();
+
+        if ( --instances_using_the_network_module == 0 )
+            ana_manager.close_connections_and_cleanup();
     }
 
     void set_raw_data_only()




Related Messages


Powered by MHonArc, Updated Thu Jul 15 05:40:12 2010