Update virBhyveProcessStop() to set monitor to NULL after calling
bhyveMonitorClose().
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
/* Destroy monitor before running the actual destroy command to prevent
* it from detecting VM shutdown and entering this cleanup routine again */
if ((priv != NULL) && (priv->mon != NULL))
- bhyveMonitorClose(priv->mon);
+ g_clear_pointer(&priv->mon, bhyveMonitorClose);
cmd = virBhyveProcessBuildDestroyCmd(driver, vm->def);
if (virCommandRun(cmd, NULL) < 0) {