[gtk/wip/chergert/for-macos-1: 2/3] macos: remove assertion from external API




commit d58c038fe86c03425a0fe2156597f1ee1753526d
Author: Christian Hergert <christian hergert me>
Date:   Tue Feb 15 12:12:45 2022 -0800

    macos: remove assertion from external API
    
    We only should be asserting in static functions. Furthermore, this function
    did not need to have GDK_BEGIN_MACOS_ALLOC_POOL as nothing is being
    allocated there which would cause pooling to get used.

 gdk/macos/gdkmacosmonitor.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gdk/macos/gdkmacosmonitor.c b/gdk/macos/gdkmacosmonitor.c
index 413b8f8c25..6df1da0edc 100644
--- a/gdk/macos/gdkmacosmonitor.c
+++ b/gdk/macos/gdkmacosmonitor.c
@@ -56,13 +56,11 @@ void
 gdk_macos_monitor_get_workarea (GdkMonitor   *monitor,
                                 GdkRectangle *geometry)
 {
-  GDK_BEGIN_MACOS_ALLOC_POOL;
-
   GdkMacosMonitor *self = (GdkMacosMonitor *)monitor;
   int x,  y;
 
-  g_assert (GDK_IS_MACOS_MONITOR (self));
-  g_assert (geometry != NULL);
+  g_return_if_fail (GDK_IS_MACOS_MONITOR (self));
+  g_return_if_fail (geometry != NULL);
 
   x = self->workarea.origin.x;
   y = self->workarea.origin.y + self->workarea.size.height;
@@ -75,8 +73,6 @@ gdk_macos_monitor_get_workarea (GdkMonitor   *monitor,
   geometry->y = y;
   geometry->width = self->workarea.size.width;
   geometry->height = self->workarea.size.height;
-
-  GDK_END_MACOS_ALLOC_POOL;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]