Class DAtExit

Inherits from:
Object
Declared in:
DAtExit.h

Class Hierarchy

    Object
      |
      +---DAtExit

Class Description

The AtExit implements a number of methods for insuring the freeing of objects during the exit of the program. This class has only class methods (singleton).

Example:
#include <stdio.h>
#include "ofc/DAtExit.h"
#include "ofc/DFile.h"

int main(int argc, char *argv[])
{
  DFile *file = [DFile new];

  if ([file open :"example.ini" :"r"])
  {
    [DAtExit add :file];       // If program exit, then automatically call [file free]

    // Read the file ..

    [file close];

    [DAtExit remove :file];    // If program exit, [file free] is not called anymore
  }

  [file free];

  return 0;
}
Last modified:
25-Aug-2008 (DAtExit.h)

Method Index

+ (void) add :(id) obj
Add an object that must be freed during program exit
Parameters:
obj - the object
Returns:
none
+ (void) remove :(id) obj
Remove an object from freeing during program exit
Parameters:
obj - the object
Returns:
none

generated 06-Sep-2008 by ObjcDoc 3.0.0