pysimconnect icon indicating copy to clipboard operation
pysimconnect copied to clipboard

How do I properly close a SimConnect object ?

Open cercata opened this issue 3 years ago • 2 comments

I'm just calling sc.Close(), but the next time I create a SimConnect() object, I don't receive new data, I get allways the last set of data the old object received.

cercata avatar Apr 04 '22 20:04 cercata

is it easy to illustrate with a simple code example? i haven't played much with that, tho the API doc seems pretty clear you just need Open() and Close(). maybe the internal handle needs to get explicitly deleted or something, tho I would have thought that occurred when the python SimConnect object was implicitly deleted when you re-assign it. does explicit del sc help after Close?

patricksurry avatar Apr 04 '22 21:04 patricksurry

This is where it's happening: https://github.com/cercata/pysim2bhap/blob/main/sim2bhap/msfsBHap.py

I tryied sc = None, I'll try del sc tomorrow

cercata avatar Apr 04 '22 22:04 cercata