Destructor – PB Docs 150

Destructor event

Description

Occurs when the DataWindow control or DataStore object is
destroyed, immediately after the Close event of a window or form.

PowerBuilder event information

Event ID: pbm_destructor

Web ActiveX event information

Event name: onDestructor

Return Values

There are no special outcomes for this event. The only code
is:

  • 0 Continue processing

Usage

The Destructor event destroys the DataWindow control or DataStore
object and removes it from memory. After it has been destroyed,
you can no longer refer to it in other event code. (If you do, a
runtime error occurs.)

note.png Restriction on methods

Calling a DataStore method that accesses the underlying DataStore
internals within this event is not a valid coding practice and can
fail silently. Such methods include RowCount, DBCancel,
and Modify.

When you issue a DESTROY on a DataStore,
the Destructor event is triggered and a Windows WM_DESTROY
message is added to the object’s message queue. WM_DESTROY
invalidates the memory for the DataStore. If the WM_DESTROY
message is handled before the method calls in the Destructor event,
methods that attempt to access the destroyed memory fail silently.

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x