How to free a object?

 

I define a object myobj like this: 

myclass myobj;

 

How to free it?

myobj.free?

 

thanks

hongbin 

 

https://www.mql5.com/en/docs/basis/variables/object_live

Local variables are deinitialized at the end of the program block, in which they were declared, and in the order opposite to their declaration. A program block is a compound operator that can be a part of selection operator switch, cycle operator (for, while, do-while), a function body or a part of the if-else operator. 

ie your myobj will be freed automatically at the end of block - appropriate closing braket }

See also https://www.mql5.com/en/articles/28 

Documentation on MQL5: Language Basics / Variables / Creating and Deleting Objects
  • www.mql5.com
Language Basics / Variables / Creating and Deleting Objects - Documentation on MQL5
 
codeidea:

I define a object myobj like this: 

...
Please, properly insert code into a post.
MQL5.community - User Memo
  • 2010.02.25
  • MetaQuotes Software Corp.
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
 
thanks