tranek / GASShooter

Advanced FPS/TPS Sample Project for Unreal Engine 4's GameplayAbilitySystem plugin
MIT License
953 stars 265 forks source link

GSWeapon Crash #12

Closed narthur157 closed 4 years ago

narthur157 commented 4 years ago

AGSWeapon crashes during level changes, as it uses a destructor rather than BeginDestroy

See ~AGSWeapon()

tranek commented 4 years ago

Would you please add reproduction steps?

Calling OpenLevel from BP to an empty map works fine in PIE and standalone for me.

narthur157 commented 4 years ago

I would have thought that would cause the issue as well. I'm not 100% sure how to reproduce it in that case, as it's likely specific to the transition sequence in my project forked from this.

For me switching over the de-initialization over to BeginDestroy fixed the issue, and seems to make sense generally as this is the proper "teardown" phase for the object rather than when UE decides to run garbage collection

tranek commented 4 years ago

Since it's an AActor, I preferEndPlay over BeginDestroy. I think I just had destructors on my mind when I wrote it. Thanks for bringing it to my attention!