[rfc][icedtea-web] More testing for IcedTeaScriptablePluginObject.cc + memory leak fixes

Adam Domurad adomurad at redhat.com
Tue Jun 4 08:58:28 PDT 2013


Hi all, I am looking into making the 'getvalue' NPAPI hook non-blocking. 
This involves the Java-in-Javascript wrappers, so I'm trying to put more 
of it under test.

Included is a leak fix and extra C++ test infrastructure + tests. It is 
working very well at detecting leaks due to 'new' without a 
corresponding 'delete'.

Before the fix two tests should report 1 leak with 'new'. After fix all 
tests should pass.

Test ChangeLog:
2013-XX-XX  Adam Domurad  <adomurad at redhat.com>

     * plugin/icedteanp/IcedTeaPluginUtils.cc: Add global state clearing
     utility functions.
     * plugin/icedteanp/IcedTeaPluginUtils.h: Same.
     * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: Test
     scriptable object creation and destruction.
     * tests/cpp-unit-tests/browser_mock.cc
     (mock_createobject): New, mocks NPAPI 'createobject'.
     * tests/cpp-unit-tests/MemoryLeakDetector.h: New, memory leak detection
     utility class.
     * tests/cpp-unit-tests/main.cc
     (ReportTestFinish): Print which tests resulted in memory leaks.


Fix ChangeLog:

2013-XX-XX  Adam Domurad  <adomurad at redhat.com>

     * plugin/icedteanp/IcedTeaScriptablePluginObject.cc
 
(IcedTeaScriptablePluginObject::get_scriptable_java_package_object): Fix
     memory leak due to allocated NPClass.
     (IcedTeaScriptableJavaPackageObject::get_scriptable_java_object):
     Same.


Cheers,
-Adam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-JS-wrapper-objects.patch
Type: text/x-patch
Size: 11537 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130604/492bc822/test-JS-wrapper-objects.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-JS-wrapper-leaks.patch
Type: text/x-patch
Size: 7110 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130604/492bc822/fix-JS-wrapper-leaks.patch 


More information about the distro-pkg-dev mailing list