Route app shutdown staging through app core
This commit is contained in:
53
src/app.cpp
53
src/app.cpp
@@ -6,6 +6,7 @@
|
||||
#include "node_progress_bar.h"
|
||||
#include "mp4enc.h"
|
||||
#include "app_core/app_frame.h"
|
||||
#include "app_core/app_shutdown.h"
|
||||
#include "app_core/app_status.h"
|
||||
#include "app_core/app_startup.h"
|
||||
#include "app_core/canvas_tool_ui.h"
|
||||
@@ -642,27 +643,41 @@ void App::update(float dt)
|
||||
void App::terminate()
|
||||
{
|
||||
LOG("App::terminate");
|
||||
ui_save();
|
||||
const auto shutdown_plan = pp::app::plan_app_shutdown();
|
||||
|
||||
NodeStrokePreview::terminate_renderer();
|
||||
rec_stop();
|
||||
if (shutdown_plan.save_ui_state)
|
||||
ui_save();
|
||||
|
||||
if (shutdown_plan.terminate_stroke_preview_renderer)
|
||||
NodeStrokePreview::terminate_renderer();
|
||||
if (shutdown_plan.stop_recording)
|
||||
rec_stop();
|
||||
|
||||
TextureManager::invalidate();
|
||||
ShaderManager::invalidate();
|
||||
layout.unload();
|
||||
layout_designer.unload();
|
||||
uirtt.destroy();
|
||||
m_face_plane.destroy();
|
||||
layers.reset();
|
||||
color.reset();
|
||||
stroke.reset();
|
||||
grid.reset();
|
||||
presets.reset();
|
||||
floating_presets.reset();
|
||||
floating_color.reset();
|
||||
floating_layers.reset();
|
||||
floating_picker.reset();
|
||||
quick_mode_state.clear();
|
||||
if (shutdown_plan.invalidate_textures)
|
||||
TextureManager::invalidate();
|
||||
if (shutdown_plan.invalidate_shaders)
|
||||
ShaderManager::invalidate();
|
||||
if (shutdown_plan.unload_layouts) {
|
||||
layout.unload();
|
||||
layout_designer.unload();
|
||||
}
|
||||
if (shutdown_plan.destroy_ui_render_target)
|
||||
uirtt.destroy();
|
||||
if (shutdown_plan.destroy_face_plane)
|
||||
m_face_plane.destroy();
|
||||
if (shutdown_plan.release_panel_nodes) {
|
||||
layers.reset();
|
||||
color.reset();
|
||||
stroke.reset();
|
||||
grid.reset();
|
||||
presets.reset();
|
||||
floating_presets.reset();
|
||||
floating_color.reset();
|
||||
floating_layers.reset();
|
||||
floating_picker.reset();
|
||||
}
|
||||
if (shutdown_plan.clear_quick_mode_state)
|
||||
quick_mode_state.clear();
|
||||
}
|
||||
|
||||
void App::update_memory_usage(size_t bytes)
|
||||
|
||||
Reference in New Issue
Block a user