Top "Object-lifetime" questions

The object lifetime (or life cycle) of an object in object-oriented programming is the time between an object is created (also known as instantiation or construction) till the object is no longer used and then destructed or freed.

call to pure virtual function from base class constructor

I have a base class MyBase that contains a pure virtual function: void PrintStartMessage() = 0 I want each derived class to …

c++ constructor abstract-class object-lifetime pure-virtual
AppDomain and MarshalByRefObject life time : how to avoid RemotingException?

When a MarshalByRef object is passed from an AppDomain (1) to another (2), if you wait 6 mins before calling a method on …

c# .net remoting appdomain object-lifetime
Object destruction in C++

When exactly are objects destroyed in C++, and what does that mean? Do I have to destroy them manually, since …

c++ exception destructor c++-faq object-lifetime
Why is a variable declared in a using statement treated as readonly?

Why using variable treated as readonly? It is c# language specification or managed languages specification? It is because c# is …

c# .net using-statement object-lifetime
C# Thread object lifetime

Suppose I have a code as follows: int Main() { if (true) { new Thread(()=> { doSomeLengthyOperation(); }).Start(); } while (true) { //do nothing } } …

c# multithreading object-lifetime
Difference between IOptionsMonitor vs. IOptionsSnapshot

According to this answer, IOptionsMonitor is registered in DI container as singleton and is capable of detecting changes through OnChange …

asp.net-core dependency-injection interface options object-lifetime
MEF keeps reference of NonShared IDisposable parts, not allowing them to be collected by GC

I've encountered somewhat of a problem in MEF's part lifetime which causes memory leaks in my Prism application. My application …

.net memory-leaks prism mef object-lifetime