fix leaks
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -122,11 +122,7 @@ SGTime::SGTime() {
|
||||
|
||||
SGTime::~SGTime()
|
||||
{
|
||||
if ( tzContainer != NULL ) {
|
||||
SGTimeZoneContainer *tmp = tzContainer;
|
||||
tzContainer = NULL;
|
||||
delete tmp;
|
||||
}
|
||||
delete tzContainer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user