You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In out product we are using the method Microsoft.AspNet.OData.Extensions.HttpConfigurationExtensions.MapODataServiceRoute(this HttpConfiguration configuration, string routeName, string routePrefix, Action configureAction) to map our OData service routes.
We have some static routes and some dynamic ones. For the dynamic ones, we need to be able to "unmap" a route which was previously added. My question is how can I do that unmapping in a clean way without having any memory leak.
Assemblies affected
Microsoft.AspNet.OData.dll v7.5.12
Reproduce steps
Check entries of HttpConfiguration.Routes and HttpConfiguration.Properties
Map a odata route using Microsoft.AspNet.OData.Extensions.HttpConfigurationExtensions.MapODataServiceRoute(this HttpConfiguration configuration, string routeName, string routePrefix, Action configureAction)
Check entries of HttpConfiguration.Routes and HttpConfiguration.Properties -> should have some added entries
Unmap the OData route. Not sure what is the best way to do. Currently we just do HttpConfiguration.Routes.Remove(routName) but that does not unmap everything so some references are still there, e.g. to the created ODataRootContainer.
Check entries of HttpConfiguration.Routes and HttpConfiguration.Properties -> should have some entries like in 1., i.e. no memory leak
Expected result
When a route is mapped and unmapped, there should not be a increase in memory.
Actual result
When there is no way to unmap a route completley, there is a memory leak.
The text was updated successfully, but these errors were encountered:
I don't think we explicitly support "unmapping" a route. Maybe that would required manually removing everything that was added as a result of the route, not sure how practical that is. This sounds like a feature request. @xuzhg could you take a look?
Issue
In out product we are using the method Microsoft.AspNet.OData.Extensions.HttpConfigurationExtensions.MapODataServiceRoute(this HttpConfiguration configuration, string routeName, string routePrefix, Action configureAction) to map our OData service routes.
We have some static routes and some dynamic ones. For the dynamic ones, we need to be able to "unmap" a route which was previously added. My question is how can I do that unmapping in a clean way without having any memory leak.
Assemblies affected
Microsoft.AspNet.OData.dll v7.5.12
Reproduce steps
Expected result
When a route is mapped and unmapped, there should not be a increase in memory.
Actual result
When there is no way to unmap a route completley, there is a memory leak.
The text was updated successfully, but these errors were encountered: