Fix crash when font not found

Now NACT::fatal() immediately exits the process.
This commit is contained in:
kichikuou
2024-04-06 08:31:37 +09:00
parent 2ae16c8c61
commit 723e5cef05
4 changed files with 16 additions and 17 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
*/
#include <stdarg.h>
#include <stdlib.h>
#include "nact.h"
#include "encoding.h"
#include "ags.h"
@@ -554,14 +555,14 @@ void NACT::select_cursor()
ags->select_cursor();
}
void NACT::fatal(const char* format, ...) {
[[noreturn]] void NACT::fatal(const char* format, ...) {
char buf[512];
va_list args;
va_start(args, format);
vsnprintf(buf, sizeof buf, format, args);
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Fatal Error: %s", buf);
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "system3", buf, g_window);
quit(0);
exit(1);
}
NACT* NACT::create(const Config& config) {