gsk: Call glDeleteSync() directly

This function does not use the standard __cdecl calling convention on
Windows, meaning using g_clear_pointer() on it directly will cause
crashes on 32-bit Windows.  Just call it directly if the GLsync it uses
exists.
This commit is contained in:
Chun-wei Fan 2024-05-23 17:09:38 +08:00 committed by Matthias Clasen
parent d51de390ba
commit db0f9b60ac
2 changed files with 11 additions and 2 deletions

View File

@ -70,7 +70,10 @@ gsk_gl_frame_cleanup (GskGpuFrame *frame)
if (self->sync)
{
glClientWaitSync (self->sync, 0, -1);
g_clear_pointer (&self->sync, glDeleteSync);
/* can't use g_clear_pointer() on glDeleteSync(), see MR !7294 */
glDeleteSync (self->sync);
self->sync = NULL;
}
self->next_texture_slot = 0;

View File

@ -249,7 +249,13 @@ gsk_gl_texture_data_free (gpointer user_data)
gdk_gl_context_make_current (data->context);
g_clear_pointer (&data->sync, glDeleteSync);
/* can't use g_clear_pointer() on glDeleteSync(), see MR !7294 */
if (data->sync)
{
glDeleteSync (data->sync);
data->sync = NULL;
}
glDeleteTextures (1, &data->texture_id);
g_object_unref (data->context);