| 303 | } |
| 304 | |
| 305 | void ManagedEditor::Exit() |
| 306 | { |
| 307 | if (WasExitCalled) |
| 308 | return; |
| 309 | WasExitCalled = true; |
| 310 | |
| 311 | // Skip if managed object is missing |
| 312 | const auto instance = GetManagedInstance(); |
| 313 | if (instance == nullptr) |
| 314 | return; |
| 315 | |
| 316 | // Call exit |
| 317 | const auto exitMethod = GetClass()->GetMethod("Exit"); |
| 318 | if (exitMethod == nullptr) |
| 319 | { |
| 320 | LOG(Fatal, "Invalid Editor assembly!"); |
| 321 | } |
| 322 | MObject* exception = nullptr; |
| 323 | exitMethod->Invoke(instance, nullptr, &exception); |
| 324 | if (exception) |
| 325 | { |
| 326 | MException ex(exception); |
| 327 | ex.Log(LogType::Warning, TEXT("ManagedEditor::Exit")); |
| 328 | LOG_STR(Fatal, TEXT("Failed to shutdown editor! ") + ex.Message); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | Window* ManagedEditor::GetMainWindow() |
| 333 | { |
nothing calls this directly
no test coverage detected