• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión044fa25a81913ff0c62ee26f6a8ed68a38090055 (tree)
Tiempo2014-02-24 15:01:20
AutorMichiro Hibari <l05102@shib...>
CommiterMichiro Hibari

Log Message

fix ticket #33102 (fix memory reak).

Cambiar Resumen

Diferencia incremental

--- a/l7vsd/include/virtualservice.h
+++ b/l7vsd/include/virtualservice.h
@@ -621,6 +621,8 @@ public:
621621 void run();
622622 void stop();
623623
624+ boost::shared_ptr<boost::thread> vs_thread_ptr;
625+
624626 void connection_active(const boost::asio::ip::tcp::endpoint &);
625627 void connection_inactive(const boost::asio::ip::tcp::endpoint &);
626628 void release_session(const tcp_session *session_ptr);
--- a/l7vsd/src/l7vsd.cpp
+++ b/l7vsd/src/l7vsd.cpp
@@ -249,7 +249,7 @@ void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, e
249249 try {
250250
251251 // create thread and run
252- vs_threads.create_thread(boost::bind(&virtual_service::run, vsptr));
252+ (*vsptr).vs_thread_ptr = boost::shared_ptr<boost::thread>(vs_threads.create_thread(boost::bind(&virtual_service::run, vsptr)));
253253
254254 } catch (...) {
255255 std::stringstream buf;
@@ -348,6 +348,8 @@ void l7vsd::del_virtual_service(const virtualservice_element *in_vselement, e
348348 if (vslist.end() != vsitr) {
349349 // vs stop
350350 (*vsitr)->stop();
351+ (*vsitr)->vs_thread_ptr->join();
352+ vs_threads.remove_thread((*vsitr)->vs_thread_ptr.get());
351353 // vs finalize
352354 (*vsitr)->finalize(err);
353355