summaryrefslogtreecommitdiff
path: root/buildscripts/idl
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2018-09-14 13:29:37 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2018-09-14 13:29:37 -0400
commit846a6c19839601ce66f27877b348a4a5150a453d (patch)
treefc4607768e3801fa4880f4bea0724686493d636f /buildscripts/idl
parent7daa72a1600fae6753034ca1bcdfd7eeceedb6ae (diff)
downloadmongo-846a6c19839601ce66f27877b348a4a5150a453d.tar.gz
SERVER-36637 IDL objects should hold owned BSONObjs
Diffstat (limited to 'buildscripts/idl')
-rw-r--r--buildscripts/idl/idl/generator.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
index dd8349dea2e..65bdfe14647 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -785,9 +785,10 @@ class _CppSourceFileWriter(_CppFileWriterBase):
return common.template_args("${method_name}(${expression})",
method_name=method_name, expression=expression)
- # BSONObjects are allowed to be pass through without deserialization
+ # BSONObjects are allowed to be pass through without deserialization but we must return
+ # them as Owned since we are going to store them in the IDL generated class
assert field.bson_serialization_type == ['object']
- return expression
+ return expression + ".getOwned()"
# Call a static class method with the signature:
# Class Class::method(const BSONElement& value)