OpenTrespasser / JurassicParkTrespasser

A git-based fork of the Jurassic Park: Trespasser source code.
98 stars 24 forks source link

CUIWnd/CVideoWnd: missing detach #136

Closed meekee7 closed 3 years ago

meekee7 commented 3 years ago

A CVideoWnd object was not detached from the UI manager after its usage. This left a dangling pointer in the UI manager, and accessing the destructed object would cause a crash. Normally the entire mainscreen window would be discarded after the video was played and the level was loaded, so this slip-up would go unnoticed. However, if the loading fails, then the mainscreen window and UI manager are not discarded, and an error screen is shown that takes you back to the menu.

Furthermore, a call to Detach is added in the destructor of CUIWnd in case it was missed before.