* Properly clean up SCGI on exceptions so it deletes the socket

file. Found by Josef Drexler.

* Handle mtime properly in resume_save.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1020 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-12-16 08:25:57 +00:00
parent 71ac2cc8e1
commit 51e27e29c8
3 changed files with 10 additions and 7 deletions
+8 -1
View File
@@ -123,7 +123,7 @@ Control::initialize() {
void
Control::cleanup() {
delete m_scgi; m_scgi = NULL;
delete m_scgi; m_scgi = NULL;
rpc::xmlrpc.cleanup();
priority_queue_erase(&taskScheduler, &m_taskShutdown);
@@ -141,6 +141,13 @@ Control::cleanup() {
display::Canvas::cleanup();
}
void
Control::cleanup_exception() {
delete m_scgi; m_scgi = NULL;
display::Canvas::cleanup();
}
void
Control::handle_shutdown() {
if (!m_shutdownQuick) {
+1
View File
@@ -81,6 +81,7 @@ public:
void initialize();
void cleanup();
void cleanup_exception();
void handle_shutdown();
+1 -6
View File
@@ -272,15 +272,10 @@ main(int argc, char** argv) {
}
control->core()->download_list()->session_save();
control->cleanup();
} catch (std::exception& e) {
display::Canvas::cleanup();
// Safe to delete here? Seem to cause problems if cleanup hasn't
// been called.
//delete control;
control->cleanup_exception();
std::cout << "rtorrent: " << e.what() << std::endl;
return -1;