fix leaks

This commit is contained in:
mfranz
2009-05-06 06:32:09 +00:00
committed by Tim Moore
parent 26b4776394
commit 1ccaf3a0bd
3 changed files with 8 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ class TcpServer
{
public:
TcpServer();
~TcpServer();
bool open();
bool process();
bool close();
@@ -25,6 +26,11 @@ TcpServer::TcpServer()
channel = new SGSocket( "", "5500", "tcp" );
}
TcpServer::~Tcpserver()
{
delete channel;
}
bool
TcpServer::open()
{

View File

@@ -55,6 +55,7 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
ibuffer = (unsigned char *) malloc(win_width*win_height*RGB3);
if ( (fp = fopen(filename, "wb")) == NULL ) {
free(ibuffer);
printf("Warning: cannot open %s\n", filename);
return false;
}

View File

@@ -122,11 +122,7 @@ SGTime::SGTime() {
SGTime::~SGTime()
{
if ( tzContainer != NULL ) {
SGTimeZoneContainer *tmp = tzContainer;
tzContainer = NULL;
delete tmp;
}
delete tzContainer;
}