removed unneeded log flushing

This commit is contained in:
hyunghwan.chung 2018-02-04 16:38:28 +00:00
parent 76c3d78d46
commit fa9e0f538a

View File

@ -171,9 +171,10 @@ void moo_fini (moo_t* moo)
moo_rbt_walk (&moo->modtab, unload_module, moo); /* unload all modules */ moo_rbt_walk (&moo->modtab, unload_module, moo); /* unload all modules */
moo_rbt_fini (&moo->modtab); moo_rbt_fini (&moo->modtab);
if (moo->log.ptr) if (moo->log.len > 0)
{ {
/* flush pending log messages just in case. */ /* flush pending log messages just in case. */
MOO_ASSERT (moo, moo->log.ptr != MOO_NULL);
moo->vmprim.log_write (moo, moo->log.last_mask, moo->log.ptr, moo->log.len); moo->vmprim.log_write (moo, moo->log.last_mask, moo->log.ptr, moo->log.len);
} }
@ -183,12 +184,13 @@ void moo_fini (moo_t* moo)
if (cb->fini) cb->fini (moo); if (cb->fini) cb->fini (moo);
} }
if (moo->log.ptr) if (moo->log.len > 0)
{ {
/* flush pending log message that could be generated by the fini /* flush pending log message that could be generated by the fini
* callbacks. however, the actual logging might not be produced at * callbacks. however, the actual logging might not be produced at
* this point because one of the callbacks could arrange to stop * this point because one of the callbacks could arrange to stop
* logging */ * logging */
MOO_ASSERT (moo, moo->log.ptr != MOO_NULL);
moo->vmprim.log_write (moo, moo->log.last_mask, moo->log.ptr, moo->log.len); moo->vmprim.log_write (moo, moo->log.last_mask, moo->log.ptr, moo->log.len);
} }