From b132e824e46a19dd373eb3e77dcda22291c90a41 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Fri, 28 Feb 2020 19:51:09 +0100
Subject: [PATCH] Fix C++ client.

---
 include/gepetto/viewer/corba/api.hh    | 4 ++--
 include/gepetto/viewer/corba/client.hh | 4 ++--
 src/client.cc                          | 2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/gepetto/viewer/corba/api.hh b/include/gepetto/viewer/corba/api.hh
index 16e8de0..6b2a600 100644
--- a/include/gepetto/viewer/corba/api.hh
+++ b/include/gepetto/viewer/corba/api.hh
@@ -8,14 +8,14 @@ namespace viewer {
 namespace corba {
 
 #if __cplusplus >= 201103L
-void applyConfiguration(const char* name, corbaserver::Transform&& t)
+inline void applyConfiguration(const char* name, corbaserver::Transform&& t)
 {
   if (!connected()) return;
   gui()->applyConfiguration(name, t);
 }
 #endif // __cplusplus > 201103L
 
-void refresh()
+inline void refresh()
 {
   if (!connected()) return;
   gui()->refresh();
diff --git a/include/gepetto/viewer/corba/client.hh b/include/gepetto/viewer/corba/client.hh
index 7caf2c3..4e53a96 100644
--- a/include/gepetto/viewer/corba/client.hh
+++ b/include/gepetto/viewer/corba/client.hh
@@ -53,7 +53,7 @@ namespace corba {
   corbaserver::GraphicalInterface_var& gui ();
 
   /// Tells whether the connection to the gui is ok.
-  bool connected ()
+  inline bool connected ()
   {
     return !CORBA::is_nil(gui());
   }
@@ -64,7 +64,7 @@ namespace corba {
   /// \param url if NULL, url is initialized with \c host and \c port.
   /// \param host, port if not NULL, url is set to = "corbaloc:iiop:host:port"
   /// \return a client to the GUI.
-  corbaserver::GraphicalInterface_var& gui (const char* windowName,
+  inline corbaserver::GraphicalInterface_var& gui (const char* windowName,
       bool dontRaise = false, const char* url = NULL,
       const char* host = "localhost", const int port = 12321)
   {
diff --git a/src/client.cc b/src/client.cc
index e2b8498..44f074a 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -110,6 +110,8 @@ namespace gepetto {
           if (windowName) client.gui()->createWindow(windowName);
         } catch (const std::runtime_error&) {
           if (!dontRaise) throw;
+        } catch (const CORBA::Exception&) {
+          if (!dontRaise) throw;
         }
       }
     }
-- 
GitLab