ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-1588: Fix warning in JvmOption class coused by non-const char array passed as constructor argument. This closes #117.
Date Fri, 02 Oct 2015 08:59:49 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1282 41297fdfe -> 46a6ecb67


IGNITE-1588: Fix warning in JvmOption class coused by non-const char array passed as constructor
argument. This closes #117.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/46a6ecb6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/46a6ecb6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/46a6ecb6

Branch: refs/heads/ignite-1282
Commit: 46a6ecb678a7438d9763bd175d3893737998fc7e
Parents: 41297fd
Author: isapego <isapego@gridgain.com>
Authored: Fri Oct 2 11:59:22 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Oct 2 11:59:22 2015 +0300

----------------------------------------------------------------------
 .../core/include/ignite/ignite_configuration.h  | 39 +++++++++++++++++++-
 1 file changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/46a6ecb6/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
index ce2d730..4e79e73 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
@@ -20,6 +20,8 @@
 
 #include <stdint.h>
 
+#include "ignite/impl/utils.h"
+
 namespace ignite
 {    
     /**
@@ -39,13 +41,46 @@ namespace ignite
         }
 
         /**
+         * Copy constructor.
+         * 
+         * @param option Other instance.
+         */
+        IgniteJvmOption(const IgniteJvmOption& option) : opt()
+        {
+            this->opt = impl::utils::CopyChars(option.opt);
+        }
+
+        /**
          * Constructor.
          *
          * @param opt Option.
          */
-        IgniteJvmOption(char* opt) : opt(opt)
+        IgniteJvmOption(const char* opt) : opt()
         {
-            // No-op.
+            this->opt = impl::utils::CopyChars(opt);
+        }
+
+        /**
+         * Destructor.
+         */
+        ~IgniteJvmOption()
+        {
+            impl::utils::ReleaseChars(opt);
+        }
+
+        /**
+         * Copy operator.
+         *
+         * @param option Other instance.
+         * @return This instance.
+         */
+        IgniteJvmOption& operator=(const IgniteJvmOption& option)
+        {
+            impl::utils::ReleaseChars(opt);
+
+            this->opt = impl::utils::CopyChars(option.opt);
+            
+            return *this;
         }
     };
 


Mime
View raw message