All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

NonPersistentObjectSpace.AutoDisposeAdditionalObjectSpacesByDefault Field

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

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.1.dll

Declaration

public static bool AutoDisposeAdditionalObjectSpacesByDefault
Public Shared AutoDisposeAdditionalObjectSpacesByDefault As Boolean

Field Value

Type Description
Boolean

true, if non-persistent 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 non-persistent 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() {
        NonPersistentObjectSpace.AutoDisposeAdditionalObjectSpacesByDefault = true;
        // ...
    }
}
See Also