mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
Merge pull request #336 from dicej/builtinelement-dispose
fix segfault in BuiltinElement::dispose
This commit is contained in:
commit
fa2ab168ce
@ -615,6 +615,7 @@ class BuiltinElement : public JarElement {
|
|||||||
const char* name,
|
const char* name,
|
||||||
const char* libraryName)
|
const char* libraryName)
|
||||||
: JarElement(s, allocator, name, false),
|
: JarElement(s, allocator, name, false),
|
||||||
|
library(0),
|
||||||
libraryName(libraryName ? copy(allocator, libraryName) : 0)
|
libraryName(libraryName ? copy(allocator, libraryName) : 0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -657,6 +658,8 @@ class BuiltinElement : public JarElement {
|
|||||||
} else if (DebugFind) {
|
} else if (DebugFind) {
|
||||||
fprintf(stderr, "unable to find %s in %s\n", symbolName, libraryName);
|
fprintf(stderr, "unable to find %s in %s\n", symbolName, libraryName);
|
||||||
}
|
}
|
||||||
|
} else if (DebugFind) {
|
||||||
|
fprintf(stderr, "unable to load %s\n", libraryName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -673,7 +676,9 @@ class BuiltinElement : public JarElement {
|
|||||||
|
|
||||||
virtual void dispose()
|
virtual void dispose()
|
||||||
{
|
{
|
||||||
library->disposeAll();
|
if (library) {
|
||||||
|
library->disposeAll();
|
||||||
|
}
|
||||||
if (libraryName) {
|
if (libraryName) {
|
||||||
allocator->free(libraryName, strlen(libraryName) + 1);
|
allocator->free(libraryName, strlen(libraryName) + 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user