Skip to content

Commit

Permalink
Avoid g_clear_object in pipewire
Browse files Browse the repository at this point in the history
Fixes the below build warnings when building with a newer version of
glib.  Seen when updating the linux sysroots for crbug.com/1012850

 [ 11629/38237 - 588 process @ 649.7/s : 17.899s ] CXX obj/third_party/webrtc/modules/desktop_capture/desktop_capture_generic/base_capturer_pipewire.o
../../third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc:253:5: warning: Not available before 2.34 [-W#pragma-messages]
    g_clear_object(&cancellable_);
    ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/gobject/gobject.h:678:36: note: expanded from macro 'g_clear_object'
                                   ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gmem.h:142:3: note: expanded from macro 'g_clear_pointer'
  GLIB_AVAILABLE_MACRO_IN_2_34
  ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gversionmacros.h:473:49: note: expanded from macro 'GLIB_AVAILABLE_MACRO_IN_2_34'
                                                ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gmacros.h:991:41: note: expanded from macro 'GLIB_UNAVAILABLE_MACRO'
                                        ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gmacros.h:988:33: note: expanded from macro '_GLIB_GNUC_DO_PRAGMA'
                                ^
<scratch space>:249:6: note: expanded from here
 GCC warning "Not available before " "2" "." "34"
     ^
../../third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc:257:5: warning: Not available before 2.34 [-W#pragma-messages]
    g_clear_object(&proxy_);
    ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/gobject/gobject.h:678:36: note: expanded from macro 'g_clear_object'
                                   ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gmem.h:142:3: note: expanded from macro 'g_clear_pointer'
  GLIB_AVAILABLE_MACRO_IN_2_34
  ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gversionmacros.h:473:49: note: expanded from macro 'GLIB_AVAILABLE_MACRO_IN_2_34'
                                                ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gmacros.h:991:41: note: expanded from macro 'GLIB_UNAVAILABLE_MACRO'
                                        ^
../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0/glib/gmacros.h:988:33: note: expanded from macro '_GLIB_GNUC_DO_PRAGMA'
                                ^
<scratch space>:254:6: note: expanded from here
 GCC warning "Not available before " "2" "." "34"
     ^
2 warnings generated.

BUG=chromium:1012850, chromium:1014947
R=tommi@webrtc.org

Change-Id: I0f72e1cd6e9b9311cf2cbd5635e7ad8fe489c350
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156980
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29506}
  • Loading branch information
tanderson-google authored and Commit Bot committed Oct 17, 2019
1 parent 04671b0 commit a6d7b02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/desktop_capture/linux/base_capturer_pipewire.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,13 @@ BaseCapturerPipeWire::~BaseCapturerPipeWire() {

if (cancellable_) {
g_cancellable_cancel(cancellable_);
g_clear_object(&cancellable_);
g_object_unref(cancellable_);
cancellable_ = nullptr;
}

if (proxy_) {
g_clear_object(&proxy_);
g_object_unref(proxy_);
proxy_ = nullptr;
}
}

Expand Down

0 comments on commit a6d7b02

Please sign in to comment.