summaryrefslogtreecommitdiff
path: root/matlab/src/Init.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2020-07-07 16:57:51 -0400
committerGitHub <noreply@github.com>2020-07-07 16:57:51 -0400
commit6c0e7e6fcabde691e7c38a814b6171f9f4e77d09 (patch)
treeaed41fdff6561e134c73da214e580be0910e6f6a /matlab/src/Init.cpp
parentCopy python dependencies to the extension directory - Close #926 (#927) (diff)
downloadice-6c0e7e6fcabde691e7c38a814b6171f9f4e77d09.tar.bz2
ice-6c0e7e6fcabde691e7c38a814b6171f9f4e77d09.tar.xz
ice-6c0e7e6fcabde691e7c38a814b6171f9f4e77d09.zip
Add class cycle detection during unmarshaling (#946)
Add support for detection of class cycles during unmarshaling in languages which do no have garbage collection: C++, Swift, and Objective-C. A `MarshalException` is thrown when a cycle is detected. The property `Ice.AcceptClassCycles` can be set to a value greater than `0` to change this behavior.
Diffstat (limited to 'matlab/src/Init.cpp')
-rw-r--r--matlab/src/Init.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/matlab/src/Init.cpp b/matlab/src/Init.cpp
index fb90429390a..6147c9de1bd 100644
--- a/matlab/src/Init.cpp
+++ b/matlab/src/Init.cpp
@@ -53,6 +53,14 @@ Ice_initialize(mxArray* args, void* propsImpl, void** r)
id.properties = deref<Ice::Properties>(propsImpl);
}
+ if(!id.properties)
+ {
+ id.properties = Ice::createProperties();
+ }
+
+ // Always accept cycles in MATLAB
+ id.properties->setProperty("Ice.AcceptClassCycles", "1");
+
*r = new shared_ptr<Ice::Communicator>(Ice::initialize(a, id));
return createResultValue(createStringList(a));
}