mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Tango: fixed second database not saved when hitting Save two times consecutively
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<!-- BEGIN_INCLUDE(manifest) -->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.introlab.rtabmap"
|
||||
android:versionCode="21"
|
||||
android:versionCode="22"
|
||||
android:versionName="@RTABMAP_VERSION@">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
@@ -1082,14 +1082,13 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
||||
|
||||
notificationManager.notify(0, n);
|
||||
}
|
||||
mOpenedDatabasePath = newDatabasePath;
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
saveThread.start();
|
||||
|
||||
mOpenedDatabasePath = newDatabasePath;
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
@@ -1145,14 +1144,13 @@ public class RTABMapActivity extends Activity implements OnClickListener {
|
||||
|
||||
notificationManager.notify(0, n);
|
||||
}
|
||||
mOpenedDatabasePath = newDatabasePath;
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
saveThread.start();
|
||||
|
||||
mOpenedDatabasePath = newDatabasePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,13 @@ void Memory::close(bool databaseSaved, bool postInitClosingEvents, const std::st
|
||||
UINFO("databaseSaved=%d, postInitClosingEvents=%d", databaseSaved?1:0, postInitClosingEvents?1:0);
|
||||
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(RtabmapEventInit::kClosing));
|
||||
|
||||
if(!databaseSaved || (!_memoryChanged && !_linksChanged))
|
||||
bool databaseNameChanged = false;
|
||||
if(databaseSaved)
|
||||
{
|
||||
databaseNameChanged = ouputDatabasePath.size() && _dbDriver->getUrl().size() && _dbDriver->getUrl().compare(ouputDatabasePath) != 0?true:false;
|
||||
}
|
||||
|
||||
if(!databaseSaved || (!_memoryChanged && !_linksChanged && !databaseNameChanged))
|
||||
{
|
||||
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(uFormat("No changes added to database.")));
|
||||
|
||||
@@ -317,7 +323,7 @@ void Memory::close(bool databaseSaved, bool postInitClosingEvents, const std::st
|
||||
if(_dbDriver)
|
||||
{
|
||||
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(uFormat("Closing database \"%s\"...", _dbDriver->getUrl().c_str())));
|
||||
_dbDriver->closeConnection(false);
|
||||
_dbDriver->closeConnection(false, ouputDatabasePath);
|
||||
delete _dbDriver;
|
||||
_dbDriver = 0;
|
||||
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit("Closing database, done!"));
|
||||
|
||||
Reference in New Issue
Block a user