| 31 | } |
| 32 | |
| 33 | bool CacheMethods() |
| 34 | { |
| 35 | if (Internal_SendLog && Internal_SendLogException && Internal_GetStackTrace) |
| 36 | return false; |
| 37 | ScopeLock lock(Locker); |
| 38 | if (Internal_SendLog && Internal_SendLogException && Internal_GetStackTrace) |
| 39 | return false; |
| 40 | |
| 41 | auto engine = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly; |
| 42 | if (engine == nullptr || !engine->IsLoaded()) |
| 43 | return true; |
| 44 | auto debugLogHandlerClass = engine->GetClass("FlaxEngine.DebugLogHandler"); |
| 45 | if (!debugLogHandlerClass) |
| 46 | return false; |
| 47 | |
| 48 | Internal_SendLog = debugLogHandlerClass->GetMethod("Internal_SendLog", 3); |
| 49 | if (!Internal_SendLog) |
| 50 | return false; |
| 51 | |
| 52 | Internal_SendLogException = debugLogHandlerClass->GetMethod("Internal_SendLogException", 1); |
| 53 | if (!Internal_SendLogException) |
| 54 | return false; |
| 55 | |
| 56 | Internal_GetStackTrace = debugLogHandlerClass->GetMethod("Internal_GetStackTrace"); |
| 57 | if (!Internal_GetStackTrace) |
| 58 | return false; |
| 59 | |
| 60 | engine->Unloading.Bind<ClearMethods>(); |
| 61 | |
| 62 | return false; |
| 63 | } |
| 64 | |
| 65 | #endif |
| 66 |
no test coverage detected