It is possible that main_runtime_ is NULL at this point. After main document is really closed, main_runtime_ will be set NULL, also OnRuntimeRemoved function will also be called. For this case, we should not called the OnMainDocumentIdle function again.