So I'm making a small game as a hobby project, and I'd like to implement plugin support. I've been trying to think of the best way to do this, and so far, it looks like using shared libraries that are loaded in at run time is my best bet.
So I made a shared library loading system and small API for some of the game features, and it's all going well... But then I made a mistake in my test plugin that caused a segfault, and brought down the whole game with it!
Is there a better way to do plugins that means they can be loaded in at run-time, but don't cause the whole game to crash if there is a bug in the plugin? Or a simple way to isolate segfaults so I can just unload the shared library if it causes a segfault? I'm using shared libraries because it seemed like the logical choice, but is there a better option that anyone can recommend?