That's why I mentioned keeping a reference. Lua will not garbage collect objects that are referenced.
So what I imagine is that the plugin manages the lifecycle of a window. Do not destroy the window in C++ at some point, but let it be garbage collected automatically.
So what I imagine is that the plugin manages the lifecycle of a window. Do not destroy the window in C++ at some point, but let it be garbage collected automatically.