Index: trunk/psLib/src/sys/psMemory.h
===================================================================
--- trunk/psLib/src/sys/psMemory.h	(revision 23305)
+++ trunk/psLib/src/sys/psMemory.h	(revision 26892)
@@ -326,6 +326,7 @@
 
 /** Free memory.  This operates much like free().
- *
+ *  
  *  @see psAlloc, psRealloc
+ *  note: we cast ptr to (void *) in case we are supplied a const pointer.
  */
 #ifdef DOXYGEN
@@ -336,5 +337,5 @@
 #ifndef SWIG
 #define psFree(ptr) \
-        psMemDecrRefCounter(ptr)
+    ptr = psMemDecrRefCounter((void *)ptr);
 #endif // ifndef SWIG
 #endif // ifdef DOXYGEN
