diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 21:40:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 21:43:13 +0100 |
commit | eee4dd746ea3fc09d51d008446ec82e3de456eed (patch) | |
tree | a883cc057f95a72ceb808ee5e4cbd8e6d98bb7f3 /include | |
parent | 8e9a7cac42d554402a6ead3a83ae8b7defc9247b (diff) |
Fix memory leaks
Change-Id: If9f7dc4a28d5e005959f0d4a0a2ed317b699f292
Diffstat (limited to 'include')
-rw-r--r-- | include/jvmfwk/framework.hxx | 20 |
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 |