RSDKModding / RSDKv3-Decompilation

A Full Decompilation of Sonic CD (2011) & Retro Engine (v3)
Other
591 stars 120 forks source link

Crash on MacOS during texture cleanup when renderer isn't active #222

Closed ScrelliCopter closed 1 year ago

ScrelliCopter commented 1 year ago

Expected Behavior

Application should close gracefully

Actual Behavior

Thread 1: EXC_BAD_ACCESS (code=1, address=0x1e0)

Steps to Reproduce

  1. Follow the instructions linked in the Readme to setup the Xcode project.
  2. Build & Run project
  3. Do something that ensures InitRenderDevice() doesn't get called (eg, rename Data.rsdk)
  4. Crash

Screenshots

No response

Log File

No response

Decompilation Version

master (01babfc)

Game Version

Blit Release (Steam/XBOX 360/PS3)

Game Revision

No response

Script Platform Type

Standard

Renderer Type

Software Renderer

Platform

MacOS Ventura 13.4.1

Additional Comments

Line in question: https://github.com/Rubberduckycooly/Sonic-CD-11-Decompilation/blob/01babfce7e9fc58960960012f03ad7a0aad6499c/RSDKv3/Drawing.cpp#L1035

This line probably shouldn't be called if there isn't a valid OpenGL context, adding

if (Engine.glContext)

before the loop fixed the issue.