Planeshift
|
00001 /* 00002 * psscf.h Keith Fulton <[email protected]> 00003 * 00004 * Copyright (C) 2001-2002 Atomic Blue ([email protected], http://www.atomicblue.org) 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation (version 2 of the License) 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 */ 00019 00020 #ifndef PSSCF_H 00021 #define PSSCF_H 00022 00027 /* Note from Keith: I would like to make this a hard assert() 00028 once we get all existing errors/leaks fixed, so we find them 00029 sooner from now on. For now it's just a printf. 00030 00031 Use like CHECK_FINAL_DECREF(rainmesh,"Rain object"); just 00032 before your DecRef or setting a csRef to NULL to delete the 00033 object. It should help us check if what we think is being 00034 freed is actually being freed. 00035 */ 00036 00037 #define CHECK_FINAL_DECREF(obj,what) \ 00038 if (obj->GetRefCount() != 1) \ 00039 { \ 00040 printf("\n***Object is NOT being freed properly in %s:%d. RefCount of %s is %d instead of 1.\n\n", \ 00041 __FILE__,__LINE__,what, obj->GetRefCount() ); \ 00042 } \ 00043 00044 #define CHECK_FINAL_DECREF_CONFIRM(obj,what) \ 00045 CHECK_FINAL_DECREF(obj,what) \ 00046 else \ 00047 { \ 00048 printf("\n***Object %s is being deleted correctly in %s:%d.\n\n",what,__FILE__,__LINE__); \ 00049 } \ 00050 00051 00054 #endif