You need a separate flag which is false by default. Set to true when initialized and back to false when destroyed.
If multi-threaded app, then make sure you mutex protect those accesses. Also, I strongly suggest you write functions to handle all of that in one place.