collect lua garbage before starter destroy. register sol ptrs.

This commit is contained in:
2019-10-12 07:38:17 +07:00
parent 9633edd1d0
commit ebbbd896d4
4 changed files with 61 additions and 1 deletions

View File

@@ -25,6 +25,10 @@ namespace e2d
bindings::bind_high(state_);
}
void luasol::collect_garbage() {
state_.collect_garbage();
}
std::optional<script> luasol::load_script(buffer_view src) {
E2D_ASSERT(is_in_main_thread());

View File

@@ -48,9 +48,9 @@ namespace
bool initialize() final {
ecs::registry_filler(the<world>().registry())
.system<flipbook_system>(world::priority_pre_update)
.system<label_system>(world::priority_pre_update)
.system<spine_pre_system>(world::priority_pre_update)
.system<spine_post_system>(world::priority_post_update)
.system<label_system>(world::priority_pre_render)
.system<render_system>(world::priority_render);
return !application_ || application_->initialize();
}
@@ -158,6 +158,8 @@ namespace e2d
}
starter::~starter() noexcept {
the<luasol>().collect_garbage();
modules::shutdown<world>();
modules::shutdown<library>();
modules::shutdown<factory>();