DelphiDelphiVCLPythonPython GUIWindows

How To Force Execution Of The Destructor Code In An Object

featuredimage24

In this post, we’ll use the DisposeOf method or DelphiVCL.Application.DisposeOf forces the execution of the destructor code in an object. Learning how to use DIsposeOf will allow you to easily build GUIs with Python Coding Software.

After the DisposeOf method is called, the object is placed in a special state, the Disposed state. This means that the destructor is not called again if DisposeOf is called again, or if the reference count reaches zero (the moment in which the memory is released).

Are there any things to be aware of when using the DisposeOf method?

The behavior of DisposeOf differs for the two generations of Delphi compilers:

  • On the Delphi desktop compilers (DCC32, DCC64, DCCOSX), the effect of calling DisposeOf remains the same, as it calls Free. 
  • On the Delphi mobile compilers (DCCIOS32, DCCIOSARM), the destructor code is executed at the same time as for the Delphi desktop compilers, but the memory is managed by the Automatic Reference Counting mechanism.

Let’s browse all the properties and methods of the DelphiVCL.Application.DisposeOf using dir() command:

See the responses in our Windows command prompt:

0dir-8427328

You can also read short information about the DelphiVCL.Application.DisposeOf using the print() command:

See the responses in our Windows command prompt:

0print-9017761

 

Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.

close
Related posts
Learn PythonPythonPython GUIVideos

This Is How To Create A Python Gui With PyQt5

Python GUI

What Are Python Debugging Tools: A Simple Definition

Learn PythonPythonPython GUIVideos

How To Make A Python GUI For An ATM System

Python

10 Resources That'll Make You Better At Python Programming Software

Deixe uma resposta

O seu endereço de e-mail não será publicado.

pt_BRPortuguese