mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-08 23:29:21 +00:00
* 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:
+8
-1
@@ -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) {
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
|
||||
void initialize();
|
||||
void cleanup();
|
||||
void cleanup_exception();
|
||||
|
||||
void handle_shutdown();
|
||||
|
||||
|
||||
+1
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user