fixed shutdown
This commit is contained in:
parent
b8f84fe713
commit
82013cba85
4 changed files with 19 additions and 10 deletions
|
@ -476,6 +476,7 @@ struct StudioAppImpl final : StudioApp
|
|||
LUMIX_DELETE(m_allocator, m_asset_browser);
|
||||
LUMIX_DELETE(m_allocator, m_property_grid);
|
||||
LUMIX_DELETE(m_allocator, m_log_ui);
|
||||
LUMIX_DELETE(m_allocator, m_render_interface);
|
||||
AssetCompiler::destroy(*m_asset_compiler);
|
||||
WorldEditor::destroy(m_editor, m_allocator);
|
||||
Engine::destroy(m_engine, m_allocator);
|
||||
|
@ -2370,12 +2371,7 @@ struct StudioAppImpl final : StudioApp
|
|||
}
|
||||
}
|
||||
|
||||
void addPlugin(MousePlugin& plugin) override
|
||||
{
|
||||
m_mouse_plugins.push(&plugin);
|
||||
}
|
||||
|
||||
|
||||
void addPlugin(MousePlugin& plugin) override { m_mouse_plugins.push(&plugin); }
|
||||
void removePlugin(GUIPlugin& plugin) override { m_gui_plugins.swapAndPopItem(&plugin); }
|
||||
void removePlugin(MousePlugin& plugin) override { m_mouse_plugins.swapAndPopItem(&plugin); }
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "engine/allocator.h"
|
||||
#include "engine/log.h"
|
||||
#include "engine/math.h"
|
||||
#include "engine/os.h"
|
||||
#include "engine/sync.h"
|
||||
#include "engine/thread.h"
|
||||
#include "engine/profiler.h"
|
||||
|
@ -345,7 +346,7 @@ void runEx(void* data, void(*task)(void*), SignalHandle* on_finished, SignalHand
|
|||
while (!worker->m_finished) {
|
||||
if (worker->m_is_backup) {
|
||||
MutexGuard guard(g_system->m_sync);
|
||||
while (!worker->m_is_enabled) {
|
||||
while (!worker->m_is_enabled && !worker->m_finished) {
|
||||
PROFILE_BLOCK("disabled");
|
||||
Profiler::blockColor(0xff, 0, 0xff);
|
||||
worker->sleep(g_system->m_sync);
|
||||
|
@ -515,7 +516,15 @@ void wait(SignalHandle handle)
|
|||
return;
|
||||
}
|
||||
|
||||
ASSERT(getWorker());
|
||||
if (!getWorker()) {
|
||||
while (!isSignalZero(handle, false)) {
|
||||
g_system->m_sync.exit();
|
||||
OS::sleep(1);
|
||||
g_system->m_sync.enter();
|
||||
}
|
||||
g_system->m_sync.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
Profiler::blockColor(0xff, 0, 0);
|
||||
FiberDecl* this_fiber = getWorker()->m_current_fiber;
|
||||
|
|
|
@ -85,7 +85,9 @@ struct UniverseViewImpl final : UniverseView {
|
|||
|
||||
~UniverseViewImpl() {
|
||||
m_font_res->getResourceManager().unload(*m_font_res);
|
||||
ASSERT(!m_icons);
|
||||
m_editor.universeCreated().unbind<&UniverseViewImpl::onUniverseCreated>(this);
|
||||
m_editor.universeDestroyed().unbind<&UniverseViewImpl::onUniverseDestroyed>(this);
|
||||
onUniverseDestroyed();
|
||||
}
|
||||
|
||||
void addCross(const DVec3& pos, float size, Color color) {
|
||||
|
@ -669,6 +671,8 @@ void SceneView::resetCameraSpeed()
|
|||
|
||||
SceneView::~SceneView()
|
||||
{
|
||||
m_editor.setView(nullptr);
|
||||
LUMIX_DELETE(m_app.getAllocator(), m_view);
|
||||
Pipeline::destroy(m_pipeline);
|
||||
m_debug_shape_shader->getResourceManager().unload(*m_debug_shape_shader);
|
||||
m_pipeline = nullptr;
|
||||
|
|
|
@ -613,7 +613,7 @@ TerrainEditor::~TerrainEditor()
|
|||
m_brush_texture->destroy();
|
||||
LUMIX_DELETE(m_world_editor.getAllocator(), m_brush_texture);
|
||||
}
|
||||
// TODO check if destruction of this is correct
|
||||
m_app.removePlugin(*this);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue