Fixed lqt slot acceptor issues #10
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The dynamically created "LqtSlotAcceptor" objects were never deleted. Wrapped it into a unique_ptr to auto-delete them, when the library is unloaded.
When multiple lua_States loaded modules (via "require") from lqt5, the application at some point crashed. The Problem was, that only one global "LqtSlotAcceptor" object is used, which holds the latest lua_State, which loaded the lqt5 module. If then a Slot from a previous lua_State was triggered the global "LqtSlotAcceptor" object accessed the wrong lua_State. To solve this, i changed the global "LqtSlotAcceptor" pointer to a std::map indexed by the "lua_State*" holding an "LqtSlotAcceptor" object for each lua_State to make sure we don´t get such conflicts.