summaryrefslogtreecommitdiff
path: root/include/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-03-10 21:40:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-03-10 21:43:13 +0100
commiteee4dd746ea3fc09d51d008446ec82e3de456eed (patch)
treea883cc057f95a72ceb808ee5e4cbd8e6d98bb7f3 /include/jvmfwk
parent8e9a7cac42d554402a6ead3a83ae8b7defc9247b (diff)
Fix memory leaks
Change-Id: If9f7dc4a28d5e005959f0d4a0a2ed317b699f292
Diffstat (limited to 'include/jvmfwk')
-rw-r--r--include/jvmfwk/framework.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index e88ae4be0b15..9a3b88479ab7 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -255,6 +255,26 @@ struct JavaInfo
rtl::ByteSequence arVendorData;
};
+namespace jfw {
+
+struct JavaInfoGuard {
+ JavaInfoGuard(JavaInfoGuard &) = delete;
+ void operator =(JavaInfoGuard) = delete;
+
+ JavaInfoGuard(): info(nullptr) {}
+
+ ~JavaInfoGuard() { delete info; }
+
+ void clear() {
+ delete info;
+ info = nullptr;
+ }
+
+ JavaInfo * info;
+};
+
+}
+
/** compares two <code>JavaInfo</code> objects for equality.
<p>Two <code>JavaInfo</code> objects are said to be equal if the contained