Planeshift
psscf.h
Go to the documentation of this file.
1 /*
2  * psscf.h Keith Fulton <keith@paqrat.com>
3  *
4  * Copyright (C) 2001-2002 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PSSCF_H
21 #define PSSCF_H
22 
27 /* Note from Keith: I would like to make this a hard assert()
28  once we get all existing errors/leaks fixed, so we find them
29  sooner from now on. For now it's just a printf.
30 
31  Use like CHECK_FINAL_DECREF(rainmesh,"Rain object"); just
32  before your DecRef or setting a csRef to NULL to delete the
33  object. It should help us check if what we think is being
34  freed is actually being freed.
35 */
36 
37 #define CHECK_FINAL_DECREF(obj,what) \
38  if (obj->GetRefCount() != 1) \
39  { \
40  printf("\n***Object is NOT being freed properly in %s:%d. RefCount of %s is %d instead of 1.\n\n", \
41  __FILE__,__LINE__,what, obj->GetRefCount() ); \
42  } \
43 
44 #define CHECK_FINAL_DECREF_CONFIRM(obj,what) \
45  CHECK_FINAL_DECREF(obj,what) \
46  else \
47  { \
48  printf("\n***Object %s is being deleted correctly in %s:%d.\n\n",what,__FILE__,__LINE__); \
49  } \
50 
51 
54 #endif