fix build with glib < 2.28 (#540)

g_clear_object() was not yet available
This commit is contained in:
Tom M 2019-06-22 10:22:23 +02:00 committed by GitHub
parent adb498f222
commit 030a497aa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -370,8 +370,9 @@ static IpatchSF2VoiceCache *convert_dls_to_sf2_instrument(fluid_instpatch_font_t
return NULL;
}
g_clear_object(&conv);
g_object_unref (conv);
conv = NULL;
/* Use voice->user_data to close open cached stores */
cache->voice_user_data_destroy = fluid_instpatch_on_voice_user_data_destroy;
@ -441,7 +442,8 @@ fluid_instpatch_font_t *new_fluid_instpatch(fluid_sfont_t *sfont, const fluid_fi
}
/* get rid of the reference we own, we dont need it any longer */
g_clear_object(&file);
g_object_unref(file);
file = NULL;
/* open a reader, this gives us a reference */
if((reader = ipatch_dls_reader_new(handle)) == NULL)
@ -455,7 +457,8 @@ fluid_instpatch_font_t *new_fluid_instpatch(fluid_sfont_t *sfont, const fluid_fi
patchfont->dls = ipatch_dls_reader_load(reader, &err);
/* unref the reader directly afterwards, not needed any longer */
g_clear_object(&reader);
g_object_unref(reader);
reader = NULL;
if(patchfont->dls == NULL)
{