MCPcopy Create free account
hub / github.com/defold/defold / AppFinalizeProfiler

Function AppFinalizeProfiler

engine/profiler/src/profiler.cpp:1095–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1093}
1094
1095static 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

Callers

nothing calls this directly

Calls 8

DeleteProfilerUIFunction · 0.85
AppParamsGetAppExitCodeFunction · 0.85
DeleteProfilerFrameFunction · 0.85
SetEnabledFunction · 0.70
ProfileIsInitializedFunction · 0.50
ProfileFinalizeFunction · 0.50
DeleteFunction · 0.50

Tested by

no test coverage detected