Any way to dispose of a live graph?

40 views
Skip to first unread message

Jeremy Kross

unread,
Jul 10, 2015, 9:53:55 PM7/10/15
to zelko...@googlegroups.com
So I'm running a little game on Zelkova.  I have a character select screen and an actual game mode.  After the user selects a character, I need to clean up all the graphs I spawned so they're not eating up memory and compute cycles during the game.  Sorry if this should be apparent, but does anyone out there know the best way to do this?

James MacAulay

unread,
Jul 11, 2015, 10:32:56 AM7/11/15
to zelko...@googlegroups.com, jeremy...@gmail.com
Have you tried calling `cljs.core.async/close!` on the live graphs? I think this should make all the goroutines bail out, release the right event listeners, and free things up for GC. Of course you also need to make sure you don't have any other references to the live graph lying around. If this doesn't work, then it's a bug that I need to fix.

-James

James MacAulay

unread,
Jul 11, 2015, 10:42:35 AM7/11/15
to zelko...@googlegroups.com, jmac...@gmail.com, jeremy...@gmail.com
Ah, I realize now that unfortunately close!-ing live graphs will lead you into another bug:


Sorry about this, I need to do some spelunking to see where channels are not being closed properly.

Jeremy Kross

unread,
Jul 11, 2015, 9:02:54 PM7/11/15
to zelko...@googlegroups.com, jeremy...@gmail.com
Oh, thanks James.  Good to know that's the intended functionality.  Many thanks for a wonderful library. 
Reply all
Reply to author
Forward
0 new messages