BUG: Custom Font in Win32 doesn't get released on exit

Okay… This took a little detective work. When you use a custom font in a win32 build and exit the program the TTF font stays active so you can’t delete the directory or rebuild into that same directory.

Reproduced on Win8 and Win10…

Here’s a link to a build of our LD Jam game to see it happen… Be forewarned you will have to reboot to remove it  :smiley:

http://ponywolf.com/ld33/1-800-monsters-win.zip

I can add this to a proper bug report, but I couldn’t find the link

I don’t think this is a bug in Corona.  Because I’ve used other Win32 apps that use custom/embedded fonts that don’t have this problem.

Are you doing an os.exit() to quit the app?

If so, then that’s the reason why you’re having this problem.  Let me explain.

In order for us to use custom/embedded fonts for native Windows UI such as TextFields and TextBoxes, we have to *privately* register the font file into the OS.  Privately as in no other app can use your font, but it still has to be registered into the OS so that Windows can use it in its native UI in your app.  When you let your app close naturally via the [x] button or via native.requestExit(), Corona will correctly unregister the font so that the font file or its directory can be deleted or moved.

So, if you are using os.exit(), then you need to change your code to use native.requestExit().  Then this problem will be solved.  :slight_smile:

That was easy… I was using os.exit()

Thanks!  

I don’t think this is a bug in Corona.  Because I’ve used other Win32 apps that use custom/embedded fonts that don’t have this problem.

Are you doing an os.exit() to quit the app?

If so, then that’s the reason why you’re having this problem.  Let me explain.

In order for us to use custom/embedded fonts for native Windows UI such as TextFields and TextBoxes, we have to *privately* register the font file into the OS.  Privately as in no other app can use your font, but it still has to be registered into the OS so that Windows can use it in its native UI in your app.  When you let your app close naturally via the [x] button or via native.requestExit(), Corona will correctly unregister the font so that the font file or its directory can be deleted or moved.

So, if you are using os.exit(), then you need to change your code to use native.requestExit().  Then this problem will be solved.  :slight_smile:

That was easy… I was using os.exit()

Thanks!