Window recreation and fail to draw properly

I’m using OF 0.9.3 OSX as a dynamic library(dylib) in other application.

I open the compiled dylib file with dlopen and then I can successfully create a window and everything works with no problem.

But when I destroy the window and recreate the window, some graphical objects such as ofImage, ofTrueTypeFont, ofVboMesh are not properly drawn after the window recreation. (no image, broken font, crash)

I had to reinitialise(redeclare?) these classes after the window recreation and before the draw call.
Then it works but I also have to reload images and fonts too.

Some other objects such as ofPath and ofMesh seem to work fine after the window recreation even without class reinitialisation.

Does this have to do with some graphical objects needing to access the window pointer in order to draw properly?
Or is something in these classes getting cleared or freed whenever the window gets destroyed?(or when OF app exits)

I would really appreciate any advice!