fix core when exiting while merging

This commit is contained in:
Matt Wells 2015-10-24 12:50:57 -07:00
parent 776b94396e
commit 66145e4396

View File

@ -635,6 +635,13 @@ void RdbMerge::doneMerging ( ) {
// then the rdbbase should be NULL i guess.
if ( saved == ENOCOLLREC ) return;
// if we are exiting then dont bother renaming the files around now.
// this prevents a core in RdbBase::incorporateMerge()
if ( g_process.m_mode == EXIT_MODE ) {
log("merge: exiting. not ending merge.");
return;
}
// get base, returns NULL and sets g_errno to ENOCOLLREC on error
RdbBase *base; if (!(base=getRdbBase(m_rdbId,m_collnum))) return;
// pass g_errno on to incorporate merge so merged file can be unlinked