From de4846310d33124802dd94f5af8ca746e5e01751 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Fri, 8 Mar 2024 02:39:57 -0500
Subject: [PATCH] Update sdbus api glue wrappers

---
 indra/newview/llappviewerlinux_api-client-glue.h | 11 ++++++++---
 indra/newview/llappviewerlinux_api-server-glue.h | 11 ++++++++---
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llappviewerlinux_api-client-glue.h b/indra/newview/llappviewerlinux_api-client-glue.h
index 56719ae020d..d38d518537a 100644
--- a/indra/newview/llappviewerlinux_api-client-glue.h
+++ b/indra/newview/llappviewerlinux_api-client-glue.h
@@ -20,22 +20,27 @@ class ViewerAppAPI_proxy
 
 protected:
     ViewerAppAPI_proxy(sdbus::IProxy& proxy)
-        : proxy_(proxy)
+        : proxy_(&proxy)
     {
     }
 
+    ViewerAppAPI_proxy(const ViewerAppAPI_proxy&) = delete;
+    ViewerAppAPI_proxy& operator=(const ViewerAppAPI_proxy&) = delete;
+    ViewerAppAPI_proxy(ViewerAppAPI_proxy&&) = default;
+    ViewerAppAPI_proxy& operator=(ViewerAppAPI_proxy&&) = default;
+
     ~ViewerAppAPI_proxy() = default;
 
 public:
     bool GoSLURL(const std::string& slurl)
     {
         bool result;
-        proxy_.callMethod("GoSLURL").onInterface(INTERFACE_NAME).withArguments(slurl).storeResultsTo(result);
+        proxy_->callMethod("GoSLURL").onInterface(INTERFACE_NAME).withArguments(slurl).storeResultsTo(result);
         return result;
     }
 
 private:
-    sdbus::IProxy& proxy_;
+    sdbus::IProxy* proxy_;
 };
 
 }} // namespaces
diff --git a/indra/newview/llappviewerlinux_api-server-glue.h b/indra/newview/llappviewerlinux_api-server-glue.h
index ba04105f966..b740c306a53 100644
--- a/indra/newview/llappviewerlinux_api-server-glue.h
+++ b/indra/newview/llappviewerlinux_api-server-glue.h
@@ -20,18 +20,23 @@ class ViewerAppAPI_adaptor
 
 protected:
     ViewerAppAPI_adaptor(sdbus::IObject& object)
-        : object_(object)
+        : object_(&object)
     {
-        object_.registerMethod("GoSLURL").onInterface(INTERFACE_NAME).withInputParamNames("slurl").withOutputParamNames("success_ret").implementedAs([this](const std::string& slurl){ return this->GoSLURL(slurl); });
+        object_->registerMethod("GoSLURL").onInterface(INTERFACE_NAME).withInputParamNames("slurl").withOutputParamNames("success_ret").implementedAs([this](const std::string& slurl){ return this->GoSLURL(slurl); });
     }
 
+    ViewerAppAPI_adaptor(const ViewerAppAPI_adaptor&) = delete;
+    ViewerAppAPI_adaptor& operator=(const ViewerAppAPI_adaptor&) = delete;
+    ViewerAppAPI_adaptor(ViewerAppAPI_adaptor&&) = default;
+    ViewerAppAPI_adaptor& operator=(ViewerAppAPI_adaptor&&) = default;
+
     ~ViewerAppAPI_adaptor() = default;
 
 private:
     virtual bool GoSLURL(const std::string& slurl) = 0;
 
 private:
-    sdbus::IObject& object_;
+    sdbus::IObject* object_;
 };
 
 }} // namespaces
-- 
GitLab