core: fix memory leak by freeing rsvg handle (#77)

This commit is contained in:
Asromo 2025-01-30 02:17:35 +07:00 committed by GitHub
parent 9c5dd1f7c8
commit dcadd3398a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -572,12 +572,14 @@ bool CHyprcursorManager::loadThemeStyle(const SCursorStyleInfo& info) {
if (!rsvg_handle_render_document(handle, PCAIRO, &rect, &error)) {
Debug::log(HC_LOG_ERR, logFn, "Failed rendering svg: {}", error->message);
g_object_unref(handle);
return false;
}
// done
cairo_surface_flush(newImage->cairoSurface);
cairo_destroy(PCAIRO);
g_object_unref(handle);
}
} else {
Debug::log(HC_LOG_ERR, logFn, "Invalid shapetype in loadThemeStyle");