Using Window's "Open With" crashes my SDL 2 program

Hello LibSDL Discourse!
I’ve made a simple text editor with SDL and SDL_TTF as a learning exercise, but I’m having a problem with Window’s “Open With” functionality in their File Explorer. When I try to open a text file using this, my text editor launches with a blank white screen for a few seconds and then crashes and closes.

In my research, I’ve found that all the “Open With” feature does is open the application in a hidden terminal and pass the file path of the file you selected. If I simulate this by launching my program with a command prompt and passing the file I want as a command-line argument and parsing it in main(), then it works great.

Does anyone know what’s going on here? My guess is it’s something within SDL that I’m missing, but I’m at a loss. I’m targetting x64 and using SDL 2.0.18 if it helps.

Thank you for your time!

I think I figured it out, here’s what I’ve learned for anyone else that comes across this problem:
It seemed to trace back to trying to render a TTF font that was null (with TTF_Render_Text). The “Open With” feature of windows puts the path of the application’s local folder as the path of the file you’re opening. So all of my fonts and resources (put in a local “resources” folder using relative paths) were missing when my program tried to look for them, which caused SDL to try to render something that didn’t exist, so it crashed.

I suppose this is why any program that does default file associations installs the application to a known path and modifies the registry, so the “open with” functionality doesn’t interfere with any resource loading.