From 2475d0010b9095de32a3104492f1139c224f1f86 Mon Sep 17 00:00:00 2001 From: smatz Date: Wed, 11 Jun 2008 12:46:28 +0000 Subject: (svn r13462) -Codechange: move DriverFactoryBase destructor definition from header file (saves ~16kB) --- src/driver.cpp | 15 +++++++++++++++ src/driver.h | 15 +-------------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/driver.cpp b/src/driver.cpp index 6e9c2c54d..583d6dba1 100644 --- a/src/driver.cpp +++ b/src/driver.cpp @@ -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); +} diff --git a/src/driver.h b/src/driver.h index 572e10cb0..af98e0fa5 100644 --- a/src/driver.h +++ b/src/driver.h @@ -67,20 +67,7 @@ public: name(NULL) {} - /** Frees memory used for this->name - */ - virtual ~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); - } + virtual ~DriverFactoryBase(); /** Shuts down all active drivers */ -- cgit v1.2.3-70-g09d2