I
I
Ivan Petrov2017-11-03 12:17:48
WPF
Ivan Petrov, 2017-11-03 12:17:48

C# wpf - how to write a constantly used method?

Hello.
I'm creating a simple window application in c# + wpf.
C languages ​​in which you need to work or monitor memory did not work.
Tell me how to do it right - when I click on the button, several objects are created and some actions are performed, the button will be pressed often.
Do I need to somehow delete objects after the method has completed so that they do not remain in memory? Or is it handled by the garbage collector?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2017-11-03
@petermzg

Methods in almost all compiled languages ​​are static, they simply pass an instance of the created object. But the instance already needs to be monitored so that it is deleted when unnecessary, in .NET the garbage collector will do this for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question