Skip to main content
All docs
V24.2
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CompositeObjectSpace.AutoDisposeAdditionalObjectSpacesByDefault Field

Specifies whether Object Spaces dispose of their inner Object Spaces from the AdditionalObjectSpaces collection when they dispose of themselves. This field affects all Object Spaces in your application if you do not specify the AutoDisposeAdditionalObjectSpaces property for a particular Object Space.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public static bool AutoDisposeAdditionalObjectSpacesByDefault

#Field Value

Type Description
Boolean

true, if Object Spaces dispose of their inner Object Spaces from the AdditionalObjectSpaces collection when they dispose of themselves; otherwise, false.

#Remarks

Dispose of Object Spaces that you stopped using because undisposed Object Spaces may lead to memory leaks. Set this property to true to automatically dispose of all additional Object Spaces simultaneously with the parent Object Space.

The following example shows how to specify this static field for a WinForms application.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win;
// ...
public partial class MySolutionWindowsFormsApplication : WinApplication {
    // ...
    public MySolutionWindowsFormsApplication() {
        CompositeObjectSpace.AutoDisposeAdditionalObjectSpacesByDefault = true;
        // ...
    }
}
See Also