Monday, September 14, 2009

Handling memory leaks

I found this gem in some code I wrote in 2003. This, ladies and gentlemen, is the proper way to avoid memory errors.

//////////////////////////////////////////////////////////////////////
/// Extremely Dangerous to do this , but the app keeps crashing
//////////////////////////////////////////////////////////////////////
void SigSegVHandler(int __SigNumber){
return;// I am ignoring all Segmentation faults
}
int main(){
signal(SIGSEGV, SigSegVHandler);
}