| 1093 | } |
| 1094 | |
| 1095 | static dmExtension::Result AppFinalizeProfiler(dmExtension::AppParams* params) |
| 1096 | { |
| 1097 | if (!ProfileIsInitialized()) // We might use the null implementation |
| 1098 | { |
| 1099 | return dmExtension::RESULT_OK; |
| 1100 | } |
| 1101 | |
| 1102 | dmProfiler::SetEnabled(false); |
| 1103 | // The profiler UI is process-static, so app-finalize must also tear it |
| 1104 | // down to avoid carrying prepared text layouts across engine reboots. |
| 1105 | DeleteProfilerUI(); |
| 1106 | |
| 1107 | if (dmExtension::AppParamsGetAppExitCode(params) == dmExtension::APP_EXIT_CODE_EXIT) |
| 1108 | { |
| 1109 | ProfileFinalize(); |
| 1110 | } |
| 1111 | |
| 1112 | if (g_ProfilerCurrentFrame) |
| 1113 | { |
| 1114 | DM_MUTEX_SCOPED_LOCK(g_ProfilerMutex); |
| 1115 | DeleteProfilerFrame(g_ProfilerCurrentFrame); |
| 1116 | g_ProfilerCurrentFrame = 0; |
| 1117 | } |
| 1118 | dmMutex::Delete(g_ProfilerMutex); |
| 1119 | g_ProfilerMutex = 0; |
| 1120 | DeleteLuaProfilerScopeStates(); |
| 1121 | |
| 1122 | return dmExtension::RESULT_OK; |
| 1123 | } |
| 1124 | |
| 1125 | } // dmProfiler |
| 1126 |
nothing calls this directly
no test coverage detected