wasapi: Don't pass CoTaskMemFree to g_clear_pointer
authorChristoph Reiter <reiter.christoph@gmail.com>
Tue, 22 May 2018 20:12:34 +0000 (22:12 +0200)
committerNirbheek Chauhan <nirbheek@centricular.com>
Wed, 23 May 2018 07:54:00 +0000 (13:24 +0530)
CoTaskMemFree has a different calling convention than GDestroyNotify
and things crash at least with MinGW.

https://bugzilla.gnome.org/show_bug.cgi?id=796280

sys/wasapi/gstwasapisink.c
sys/wasapi/gstwasapisrc.c

index 3fa370dc4a26ed9ca2a2ec5cfddd9d49d4f2c364..c636bca67af680ffbd0afb7f549d672ba72e10ff 100644 (file)
@@ -208,7 +208,8 @@ gst_wasapi_sink_finalize (GObject * object)
 {
   GstWasapiSink *self = GST_WASAPI_SINK (object);
 
-  g_clear_pointer (&self->mix_format, CoTaskMemFree);
+  CoTaskMemFree (self->mix_format);
+  self->mix_format = NULL;
 
   CoUninitialize ();
 
index b5a97a2e2f7e1f91e4d00b6168e9c1e6c6d60c2b..420ddbda5501bb7d6587d142b19bc62c965d28d5 100644 (file)
@@ -227,7 +227,8 @@ gst_wasapi_src_finalize (GObject * object)
 {
   GstWasapiSrc *self = GST_WASAPI_SRC (object);
 
-  g_clear_pointer (&self->mix_format, CoTaskMemFree);
+  CoTaskMemFree (self->mix_format);
+  self->mix_format = NULL;
 
   CoUninitialize ();