ENH: fix leaks and turn on by default
This commit is contained in:
parent
66fff9d4b7
commit
50c5d5a3d5
|
@ -137,7 +137,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
||||||
SET(KWSYS_USE_IOStream 1)
|
SET(KWSYS_USE_IOStream 1)
|
||||||
SET(KWSYS_USE_DateStamp 1)
|
SET(KWSYS_USE_DateStamp 1)
|
||||||
SET(KWSYS_USE_String 1)
|
SET(KWSYS_USE_String 1)
|
||||||
# SET(KWSYS_USE_SystemInformation 1)
|
SET(KWSYS_USE_SystemInformation 1)
|
||||||
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
||||||
|
|
||||||
# Setup the large file support default.
|
# Setup the large file support default.
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include KWSYS_HEADER(SystemInformation.hxx)
|
#include KWSYS_HEADER(SystemInformation.hxx)
|
||||||
#include KWSYS_HEADER(Process.h)
|
#include KWSYS_HEADER(Process.h)
|
||||||
#include KWSYS_HEADER(ios/iostream)
|
#include KWSYS_HEADER(ios/iostream)
|
||||||
|
#include KWSYS_HEADER(ios/sstream)
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/utsname.h> // int uname(struct utsname *buf);
|
#include <sys/utsname.h> // int uname(struct utsname *buf);
|
||||||
#endif
|
#endif
|
||||||
|
@ -171,35 +172,35 @@ const char * SystemInformation::GetVendorID()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the type ID of the CPU */
|
/** Return the type ID of the CPU */
|
||||||
const char * SystemInformation::GetTypeID()
|
kwsys_stl::string SystemInformation::GetTypeID()
|
||||||
{
|
{
|
||||||
char * temp = new char[32];
|
kwsys_ios::ostringstream str;
|
||||||
sprintf(temp,"%d",this->ChipID.Type);
|
str << this->ChipID.Type;
|
||||||
return temp;
|
return str.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the family of the CPU present */
|
/** Return the family of the CPU present */
|
||||||
const char * SystemInformation::GetFamilyID()
|
kwsys_stl::string SystemInformation::GetFamilyID()
|
||||||
{
|
{
|
||||||
char * temp = new char[32];
|
kwsys_ios::ostringstream str;
|
||||||
sprintf(temp,"%d",this->ChipID.Family);
|
str << this->ChipID.Family;
|
||||||
return temp;
|
return str.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the model of CPU present */
|
// Return the model of CPU present */
|
||||||
const char * SystemInformation::GetModelID()
|
kwsys_stl::string SystemInformation::GetModelID()
|
||||||
{
|
{
|
||||||
char * temp = new char[32];
|
kwsys_ios::ostringstream str;
|
||||||
sprintf(temp,"%d",this->ChipID.Model);
|
str << this->ChipID.Model;
|
||||||
return temp;
|
return str.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the stepping code of the CPU present. */
|
/** Return the stepping code of the CPU present. */
|
||||||
const char * SystemInformation::GetSteppingCode()
|
kwsys_stl::string SystemInformation::GetSteppingCode()
|
||||||
{
|
{
|
||||||
char * temp = new char[32];
|
kwsys_ios::ostringstream str;
|
||||||
sprintf(temp,"%d",this->ChipID.Revision);
|
str << this->ChipID.Revision;
|
||||||
return temp;
|
return str.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the stepping code of the CPU present. */
|
/** Return the stepping code of the CPU present. */
|
||||||
|
@ -2649,7 +2650,8 @@ bool SystemInformation::QueryOSInformation()
|
||||||
this->OSRelease = "Unknown";
|
this->OSRelease = "Unknown";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
delete [] operatingSystem;
|
||||||
|
operatingSystem = 0;
|
||||||
|
|
||||||
// Get the hostname
|
// Get the hostname
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
|
|
|
@ -113,10 +113,10 @@ public:
|
||||||
|
|
||||||
const char * GetVendorString();
|
const char * GetVendorString();
|
||||||
const char * GetVendorID();
|
const char * GetVendorID();
|
||||||
const char * GetTypeID();
|
kwsys_stl::string GetTypeID();
|
||||||
const char * GetFamilyID();
|
kwsys_stl::string GetFamilyID();
|
||||||
const char * GetModelID();
|
kwsys_stl::string GetModelID();
|
||||||
const char * GetSteppingCode();
|
kwsys_stl::string GetSteppingCode();
|
||||||
const char * GetExtendedProcessorName();
|
const char * GetExtendedProcessorName();
|
||||||
const char * GetProcessorSerialNumber();
|
const char * GetProcessorSerialNumber();
|
||||||
int GetProcessorCacheSize();
|
int GetProcessorCacheSize();
|
||||||
|
|
Loading…
Reference in New Issue