From 4cf4089719737e158c82b0e5479ea000f9ee4bbd Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 31 Dec 2006 09:38:26 +0000 Subject: [PATCH] fixed 100% CPU on shutdown --- library/cpp/flood_core.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/cpp/flood_core.cpp b/library/cpp/flood_core.cpp index 293a4b983..427837f9a 100755 --- a/library/cpp/flood_core.cpp +++ b/library/cpp/flood_core.cpp @@ -286,7 +286,9 @@ static PyObject *torrent_init(PyObject *self, PyObject *args) NDEBUG); // Tell Boost that we are on *NIX, so bloody '.'s are ok inside a directory name! - boost::filesystem::path::default_name_check(empty_name_check); + try { + boost::filesystem::path::default_name_check(empty_name_check); + } catch (boost::filesystem::filesystem_error&) {} // Already been done, if re-initing char *client_ID, *user_agent; python_long v1,v2,v3,v4; @@ -336,12 +338,12 @@ static PyObject *torrent_init(PyObject *self, PyObject *args) static PyObject *torrent_quit(PyObject *self, PyObject *args) { + printf("core: removing torrents...\r\n"); + delete M_torrents; printf("core: shutting down session...\r\n"); delete M_ses; // 100% CPU... printf("core: removing settings...\r\n"); delete M_settings; - printf("core: removing torrents...\r\n"); - delete M_torrents; Py_DECREF(M_constants);