(svn r13462) -Codechange: move DriverFactoryBase destructor definition from header file (saves ~16kB)

This commit is contained in:
smatz
2008-06-11 12:46:28 +00:00
parent 506cde94b6
commit 2475d0010b
2 changed files with 16 additions and 14 deletions

View File

@@ -183,3 +183,18 @@ char *DriverFactoryBase::GetDriversInfo(char *p, const char *last)
return p;
}
/** Frees memory used for this->name
*/
DriverFactoryBase::~DriverFactoryBase() {
if (this->name == NULL) return;
/* Prefix the name with driver type to make it unique */
char buf[32];
strecpy(buf, GetDriverTypeName(type), lastof(buf));
strecpy(buf + 5, this->name, lastof(buf));
GetDrivers().erase(buf);
if (GetDrivers().empty()) delete &GetDrivers();
free(this->name);
}