Recent

Author Topic: Basic question about classes and objects  (Read 2262 times)

dseligo

  • Sr. Member
  • ****
  • Posts: 314
Re: Basic question about classes and objects
« Reply #30 on: April 22, 2021, 10:22:38 am »
Quote
What will happen with my money (created object) then?

This is a swiss bank account, and the bank will charge you for keeping the account open, and if you do not pay, Interpol will inspect you for keeping possible dark money.  :D

If the memory is not freed, it is regarded as taken and not available to other applications.

Or: if account isn't closed and all cards are lost, then safe is occupied, and no one can access it anymore (not even bank).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7283
  • Debugger - SynEdit - and more
    • wiki
Re: Basic question about classes and objects
« Reply #31 on: April 22, 2021, 03:48:38 pm »
Well to go for the banking analogy.

What puzzles me in this analogy is this: Why do I have to close my account in the end (Free, Destroy) if I still have money on the account?
What will happen with my money (created object) then?  :)

The money is less important in that case, but yes its gone for good. (i.e. inaccessible)

But the bank only has a certain amount of accounts (They need physical space to store each account). So evtl, the bank is full, and you can no longer open new accounts.
Besides that, it's good practice to be tidy, help the bank to be tidy too, and get rid of unused accounts.

Zvoni

  • Hero Member
  • *****
  • Posts: 627
Re: Basic question about classes and objects
« Reply #32 on: April 22, 2021, 03:54:17 pm »
And now everybody knows, how the IRS sniffs out the "black-money-accounts":
They are memory-leaks  :D :D :D :D :D
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

dseligo

  • Sr. Member
  • ****
  • Posts: 314
Re: Basic question about classes and objects
« Reply #33 on: April 22, 2021, 07:15:22 pm »
And now everybody knows, how the IRS sniffs out the "black-money-accounts":
They are memory-leaks  :D :D :D :D :D

They use Heaptrc unit (-gh) :D

 

TinyPortal © 2005-2018