/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: freeFile.c,v 1.8 1999/11/26 16:25:56 simonmar Exp $
+ * $Id: freeFile.c,v 1.10 2000/04/11 20:44:18 panne Exp $
*
* Giving up files
*/
before we *really* shut down (dumping stats etc.)
*/
void
-freeStdFile(StgForeignPtr fp)
+freeStdFile(StgAddr fp)
{ return; }
void
-freeStdFileObject(StgForeignPtr ptr)
+freeStdFileObject(StgAddr ptr)
{
IOFileObject* fo = (IOFileObject*)ptr;
int rc;
}
void
-freeFileObject(StgForeignPtr ptr)
+freeFileObject(StgAddr ptr)
{
/*
* The finaliser for the file objects embedded in Handles. The RTS
* (via closeFile()), we will have given
* up our process lock, so we break off and just return.
*/
- return;
+ if ( fo->buf != NULL ) {
+ free(fo->buf);
+ }
+ free(fo);
+ return;
}
if (fo->buf != NULL && fo->bufWPtr > 0) {
#endif
/* Error or no error, we don't care.. */
+ if ( fo->buf != NULL ) {
+ free(fo->buf);
+ }
+ free(fo);
+
return;
}