Fix segfault in TM finalize action

(cherry picked from commit 6cee0680b9)
This commit is contained in:
Carlos Martín authored and Ruben S. Montero committed 2013-11-07 19:15:35 +01:00
1 parent a875246109
commit bbfde81215
1 file changed
+22 -9
+22 -9
View File
@@ -165,6 +165,15 @@ void TransferManager::do_action(const string &action, void * arg)
delete static_cast<int *>(arg);
if (action == ACTION_FINALIZE)
{
NebulaLog::log("TrM",Log::INFO,"Stopping Transfer Manager...");
MadManager::stop();
return;
}
vm = vmpool->get(vid,true);
if (vm == 0)
@@ -172,10 +181,20 @@ void TransferManager::do_action(const string &action, void * arg)
return;
}
hid = vm->get_hid();
vm->unlock();
if (vm->hasHistory())
{
hid = vm->get_hid();
host = hpool->get(hid,true);
vm->unlock();
host = hpool->get(hid,true);
}
else
{
vm->unlock();
host = 0;
}
if ( host == 0)
{
@@ -334,12 +353,6 @@ void TransferManager::do_action(const string &action, void * arg)
{
driver_cancel_action(vid);
}
else if (action == ACTION_FINALIZE)
{
NebulaLog::log("TrM",Log::INFO,"Stopping Transfer Manager...");
MadManager::stop();
}
else
{
ostringstream oss;