I'm attempting to port over some code to the new G++ on Ubuntu Server. I'm not sure what this code is trying to do but at quick glance, it's trying to delete the memory associated with a pointer.
class mem_block
{
public:
class mem_block* next;
void* pntr;
int size;
mem_block( int i ) {
record_new( sizeof( mem_block ), MEM_MEMORY );
size = i;
pntr = new char[size];
return;
}
~mem_block( ) {
record_delete( sizeof( mem_block ), MEM_MEMORY );
delete *pntr; // Troubled line.
return;
}
};
Now I've tried delete [] pntr; (as it was originally), it's current form, etc... I'd hate to comment the code out as that would create a massive memory leak I'm sure.
Any ideas? It gives me unable to delete void* and in this case, void* is not a pointer-to-object type