Currently I'm writing an Engine. How I have it right now is thatgame engine, where the engine is written in a project and exports a dll. Ondll file. In another project, in the same solution as the engine, there is a sandbox project which uses the engine.
Like this However, I write code the engine and sandbox. But there is a bug. The way to produce this bug is that,
I run the sandbox project in debug mode with the engine dll. When iI spam my mouse and keyboard for a few seconds, and close the program via the exit button. The, the program crashes.
In debug mode. The crash is here with an error:

Exception thrown at 0x00000043 in phantom-sandbox.exe: 0xC0000005: Access violation executing location 0x00000043.
If there is a handler for this exception, the program may be safely continued.
I found out what produces the source of the bug. Since imI'm currently writing the engine for opengl.OpenGL, I have to use initialize glewGLEW, and iI need to create a HGLRC. So i do that. But this is the issueHGLRC. If iI don't initialize it and try to recreate the bug. Everything is all goochithis HGLRC, everything works.
But this can never beThis is not the ideal solution, since I need to use openglOpenGL for my engine. So iI went forth and decided to not exportwithout exporting the dll.dll from the engine. But instead make, making the engine an application, instead. So iI made a main.cppmain.cpp, and wrote stuffit to use the engine. Enabled opengl, enabling OpenGL rendering. TriedI tried to recreate the bug. But, but everything works!
So at first I thought it might be me being stupid with opengl. ButOpenGL, but then i found out it works when i make my engine an application. So now i'mI'm thinking it might be my engine. How do I fix this?
Has anyone had this issue before ? Or does anyone know why thisHere is happening ? Any solutions ?my code, where it errors:
int const main_result = invoke_main()
__telemetry_main_return_trigger(nullptr);
if(!__scrt_is_managed_app())
exit(main_result)l
if(!has_actor) // < this is the line being sent to the call stack
_cexit();
__scrt_unititialize_crt(true, false);
return main_result;
}
__except (_seh_filter_exe(GetExceptionCode(), GetExceptionInformation()))
{
int const main_result = GetExceptionCode();
if(!__scrt_is_managed_app())
_exit(main_result);
Thank you in advance ~Here is the call stack:
