# class KStaticDeleter | little helper class to clean up static objects that are held as pointer. More...
Definition | `#include <kstaticdeleter.h>`
Template form | KStaticDeleter<class type>
Inherits | KStaticDeleterBase [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KStaticDeleter ()
- type * setObject ( type *obj, bool isArray = false)
- virtual void destructObject ()
- virtual ~KStaticDeleter ()

## Detailed Description

little helper class to clean up static objects that are held as pointer.

A typical use is static KStaticDeleter<MyClass> sd;

MyClass::self() { if (!_self) { _self = sd.setObject(new MyClass()); } }

KStaticDeleter () | ### KStaticDeleter

type * setObject ( type *obj, bool isArray = false) | ### setObject

sets the object to delete and registers the object to be deleted to KGlobal. if the given object is 0, the former registration is unregistred

Parameters:

isArray | tells the destructor to delete an array instead of an object

void destructObject () | ### destructObject

[virtual]

Reimplemented from KStaticDeleterBase.

~KStaticDeleter () | ### ~KStaticDeleter

[virtual]

Generated by: root@sparc.ports.openbsd.org on Wed May 2 09:34:58 2001, using kdoc 2.0a53.