If GetControllerTypeInternal falls back to creating an instance, it should also release it (#8196)
This commit is contained in:
@@ -25,7 +25,10 @@ namespace Umbraco.Web.Mvc
|
||||
|
||||
//we have no choice but to instantiate the controller
|
||||
var instance = factory.CreateController(requestContext, controllerName);
|
||||
return instance?.GetType();
|
||||
var controllerType = instance?.GetType();
|
||||
factory.ReleaseController(instance);
|
||||
|
||||
return controllerType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,10 @@ namespace Umbraco.Web.Mvc
|
||||
|
||||
//we have no choice but to instantiate the controller
|
||||
var instance = factory.CreateController(requestContext, controllerName);
|
||||
return instance?.GetType();
|
||||
var controllerType = instance?.GetType();
|
||||
factory.ReleaseController(instance);
|
||||
|
||||
return controllerType;
|
||||
}
|
||||
|
||||
return GetControllerType(requestContext, controllerName);
|
||||
|
||||
Reference in New Issue
Block a user