# sdl2-compat: Restore log priorities after SDL\_Quit

**URL:** <https://discourse.libsdl.org/t/sdl2-compat-restore-log-priorities-after-sdl-quit/54046>\
**Category:** SDL Commits\
**Created:** [September 6, 2024, 3:42pm UTC](https://discourse.libsdl.org/t/sdl2-compat-restore-log-priorities-after-sdl-quit/54046 "2024-09-06T15:42:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [September 6, 2024, 3:42pm UTC](https://discourse.libsdl.org/t/sdl2-compat-restore-log-priorities-after-sdl-quit/54046/1 "2024-09-06T15:42:02Z")

</div>

> <https://github.com/libsdl-org/sdl2-compat/commit/4706e73facea0d67ed00394672e366d72d6d0466>

```diff
From 4706e73facea0d67ed00394672e366d72d6d0466 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 6 Sep 2024 16:32:58 +0200
Subject: [PATCH] Restore log priorities after SDL_Quit

---
 src/sdl2_compat.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 4e55e88..f369cd9 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -5042,6 +5042,8 @@ SDL_InitSubSystem(Uint32 flags)
 SDL_DECLSPEC void SDLCALL
 SDL_Quit(void)
 {
+ int i;
+ SDL_LogPriority priorities[SDL_LOG_CATEGORY_CUSTOM];
     relative_mouse_mode = SDL2_FALSE;
 
     if (SDL3_WasInit(SDL_INIT_VIDEO)) {
@@ -5089,7 +5091,15 @@ SDL_Quit(void)
         timers = 0;
     }
 
+ for (i = 0; i < SDL_LOG_CATEGORY_CUSTOM; i++) {
+ priorities[i] = SDL3_GetLogPriority(i);
+ }
+
     SDL3_Quit();
+
+ for (i = 0; i < SDL_LOG_CATEGORY_CUSTOM; i++) {
+ SDL3_SetLogPriority(i, priorities[i]);
+ }
 }
 
 SDL_DECLSPEC void SDLCALL

```
