DSWaylandSurface: add hasResource() to check validity of a DSWaylandSurface instance 39/241839/1
authorSung-Jin Park <sj76.park@samsung.com>
Tue, 18 Aug 2020 05:35:22 +0000 (14:35 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:11:58 +0000 (19:11 +0900)
Change-Id: I2131ca2f173a2e2a6e43f1ad1560d94cb3920b50
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSWaylandServer/DSWaylandSurface.cpp
src/DSWaylandServer/DSWaylandSurface.h

index 9896f38..60d2f56 100644 (file)
@@ -211,4 +211,13 @@ struct ::wl_resource *DSWaylandSurface::getWlResource()
        return priv->resource()->handle;
 }
 
+bool DSWaylandSurface::hasResource()
+{
+       DS_GET_PRIV(DSWaylandSurface);
+
+       if (priv->resource())
+               return true;
+       return false;
+}
+
 } /* namespace display_server */
index c7519dc..7cc360b 100644 (file)
@@ -63,6 +63,7 @@ public:
        void registerCallbackSurfaceCommitted(DSObject *slot, std::function<void(std::shared_ptr<DSWaylandSurfaceCommitInfo> commitInfo)> func);
 
        struct ::wl_resource *getWlResource();
+       bool hasResource();
 
 private:
        // signals