In my game engine which used Vulkan, I'm setting it up so that a game can be completely written in AngelScript. One of my functions that I bound in AngelScript is a call that tells Vulkan to wait for idle. Before you can free assets, you need to be sure they are not in the rendering pipeline so in the AngelScript destructor, I'm doing that before further cleanup.
Calling these functions from the AngelScript class destructor causes a segment fault. I can call these same functions anywhere else in the AngelScript class but not from the destructor. Is the destructor doing something different?
class CGame
{
~CGame()
{
// Wait for all rendering to be finished
Device.waitForIdle();
// Destroy the window and render device instance
Device.destroy();
}