Resource manager

l’ve got a resource manager that initialises the graphics card, does
some drawing and then bring the card back to text mode. one problem l’m
facing is that in the first attempt the client calls the resmgr, and the
resmgr does the drawing and every thing is okay. but when called for the
second time the resmgr just closes itsself, and it looks like it can not
be openned anymore. so its like everytime l access the resmgr, l have to
restarrt it again.