OpenTrespasser / JurassicParkTrespasser

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

Fix level transition crash #80

Closed meekee7 closed 4 years ago

meekee7 commented 4 years ago

When transitioning to a new level the game would crash. The cause is that the texture manager holds rptrs to CTexture objects, But the memory where the CTexture objects are stored is invalidated before reset() is called on the texture manager, leaving those rptrs dangling. When reset() is finally called and the rptrs are destructed in the texture manager, this causes memory access violations. To resolve this problem, a texture manager reset is performed before invalidating the load heap where the CTexture objects are stored.