Bull DPX/20 Guia do Utilizador Página 167

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 424
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 166
SOM Kernel Reference 1-155
somUninit Method
Purpose
Un-initializes the receiving object. Designed to be overridden by class implementors. Not
normally invoked directly by object clients.
IDL Syntax
void somUninit ( );
Note: For backward compatibility, this method does not take an Environment parameter.
Description
The somUninit method performs the inverse of object initialization. Class implementors that
introduce instance data that points to allocated storage should override somUninit so
allocated storage can be freed when an object is freed.
This method is called automatically by somFree to clean up anything necessary (such as
extra storage dynamically allocated to the object) before somFree releases the storage
allocated to the object itself.
Code responsible for freeing an object must first know that there will be no further
references to this object. Once this is known, this code would normally invoke somFree
(which calls somUninit). In cases where somRenew was used to create an object instance,
however, somFree cannot be called (for example, the storage containing the object may
simply be a location on the stack), and in this case, somUninit must be called explicitly.
When overriding this method, always call the parent-class versions of this method after
doing your own un-initialization. Furthermore, just as with somInit, because your method
may be called multiple times (due to multiple inheritance), you should zero out references
to memory that is freed, and check for zeros before freeing memory and calling the parent
methods.
Parameters
receiver A pointer to the object to be un-initialized.
Vista de página 166
1 2 ... 162 163 164 165 166 167 168 169 170 171 172 ... 423 424

Comentários a estes Manuais

Sem comentários