Cocoa Port: Fix yet another crash-on-exit bug that could happen when running on an older system.

This commit is contained in:
rogerman 2024-07-12 12:00:49 -07:00
parent dd88556d53
commit d480f95d79
2 changed files with 9 additions and 0 deletions

View File

@ -4763,6 +4763,13 @@ void GPUSubsystem::_UpdateFPSRender3D()
void GPUSubsystem::SetEventHandler(GPUEventHandler *eventHandler) void GPUSubsystem::SetEventHandler(GPUEventHandler *eventHandler)
{ {
if ( (eventHandler == NULL) && (this->_event != this->_defaultEventHandler) )
{
this->ForceFrameStop();
this->_event = this->_defaultEventHandler;
return;
}
this->_event = eventHandler; this->_event = eventHandler;
} }

View File

@ -193,6 +193,8 @@ GPU3DInterface *core3DList[GPU_3D_RENDERER_COUNT+1] = {
- (void)dealloc - (void)dealloc
{ {
GPU->SetEventHandler(NULL); // Unassigned our event handler before we delete it.
delete fetchObject; delete fetchObject;
delete gpuEvent; delete gpuEvent;