make private copy of libraryName in BuiltinElement

This commit is contained in:
Joel Dice 2008-04-01 16:36:00 -06:00
parent 1c49b3bc1b
commit b12226e878

View File

@ -443,7 +443,7 @@ class BuiltinElement: public JarElement {
BuiltinElement(System* s, const char* name, unsigned nameLength,
const char* libraryName):
JarElement(s, name, nameLength),
libraryName(libraryName)
libraryName(libraryName ? copy(s, &libraryNameLength, libraryName) : 0)
{ }
virtual void init() {
@ -469,10 +469,12 @@ class BuiltinElement: public JarElement {
virtual void dispose() {
JarElement::dispose();
library->disposeAll();
free(s, libraryName, libraryNameLength + 1);
}
System::Library* library;
const char* libraryName;
unsigned libraryNameLength;
};
Element*