From 235da004cd4f510140001c6e0798edbab56d17ce Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sun, 6 Oct 2024 16:07:11 +0200 Subject: [PATCH] Add asserts to explode the process earliest possible moment --- src/controllers/plugins/Plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/controllers/plugins/Plugin.cpp b/src/controllers/plugins/Plugin.cpp index 22c9ef987..932093097 100644 --- a/src/controllers/plugins/Plugin.cpp +++ b/src/controllers/plugins/Plugin.cpp @@ -234,6 +234,12 @@ Plugin::~Plugin() this->callbacks.clear(); lua_close(this->state_); } + assert(this->ownedCommands.empty() && + "This must be empty or destructor of sol::protected_function would " + "explode malloc structures later"); + assert(this->callbacks.empty() && + "This must be empty or destructor of sol::protected_function would " + "explode malloc structures later"); } int Plugin::addTimeout(QTimer *timer) {