gizak / termui

Golang terminal dashboard
MIT License
13.11k stars 786 forks source link

Init() cleanly after Close() #147

Closed kenan-rhoton closed 6 years ago

kenan-rhoton commented 7 years ago

This is not the greatest or most beautiful solution to #100, but it does the job.

It's basically saying: "Hey, Garbage Collector, take care of cleaning up for me, will ya?"

Any improvements are welcome, but I've tried freeing up pretty much everything in DefaultEvtStream to avoid discarding it like a madman, yet it seems that the Handles never get properly freed (probably due to my lack of understanding of the system).

kenan-rhoton commented 7 years ago

I believe a call to DefaultEvtStream.ResetHandles() or similar is needed, but I couldn't find a test case where that was the case...

cjbassi commented 6 years ago

Thanks!