runevision,
@runevision@mastodon.gamedev.place avatar

Bleh, the simple sample project I want to ship with LayerProcGen has started frequently crashing when exiting Play Mode. It's because I dispose the NativeArrays it uses on Application.quitting to avoid leaks, but some of the generation threads are still accessing the arrays, despite calling Thread.Abort() on them. For unpredictable reasons it doesn't cause issue in my own game.

I've tried a few fixes that didn't work, and I think I just don't know how to fix it properly.

bitinn,
@bitinn@mastodon.gamedev.place avatar

@runevision delay for a frame and see how it goes? we had similar crash on exit when using ECS in Unity projects. I think you should be able to hook into exit event.

runevision,
@runevision@mastodon.gamedev.place avatar

@bitinn Which exit event do you mean?

bitinn,
@bitinn@mastodon.gamedev.place avatar

@runevision I will have to look it up, how do you expect users to quit?

bitinn,
@bitinn@mastodon.gamedev.place avatar
runevision,
@runevision@mastodon.gamedev.place avatar

@bitinn That's editor API, I can't use it from runtime code. And I believe the crash would happen at runtime too, just usually when quitting the application.

Anyway, I'll go with a solution discussed in some of the other replies, but thanks!

bitinn,
@bitinn@mastodon.gamedev.place avatar

@runevision also you should be able to terminate long running threads, are they real threads or ECS workers? If you have very long running single thread worker perhaps you can refactor it into something that process in chunks.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • modclub
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • cubers
  • GTA5RPClips
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • tacticalgear
  • ethstaker
  • kavyap
  • Durango
  • anitta
  • everett
  • Leos
  • provamag3
  • mdbf
  • ngwrru68w68
  • cisconetworking
  • tester
  • osvaldo12
  • megavids
  • khanakhh
  • normalnudes
  • JUstTest
  • lostlight
  • All magazines