File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,6 +187,9 @@ ContentRedirectionApiErrorType CRAddFSLayerEx(CRLayerHandle *handle, const char
187187
188188
189189ContentRedirectionApiErrorType CRRemoveFSLayer (CRLayerHandle handle) {
190+ if (!gThreadsRunning ) { // if no threads a running we have removed the layers anyway
191+ return CONTENT_REDIRECTION_API_ERROR_NONE ;
192+ }
190193 if (!remove_locked_first_if (gFSLayerMutex , gFSLayers , [handle](auto &cur) { return (CRLayerHandle) cur->getHandle () == handle; })) {
191194 DEBUG_FUNCTION_LINE_WARN (" CONTENT_REDIRECTION_API_ERROR_LAYER_NOT_FOUND for handle %08X" , handle);
192195 return CONTENT_REDIRECTION_API_ERROR_LAYER_NOT_FOUND ;
@@ -238,6 +241,7 @@ ContentRedirectionApiErrorType CRAddDeviceABI(const ContentRedirectionDeviceABI
238241 *resultOut = AddDevice (host_dev);
239242
240243 if (*resultOut < 0 ) {
244+ DEBUG_FUNCTION_LINE_WARN (" AddDevice failed: %d" , *resultOut);
241245 DevoptabTrampoline::ClearDevoptab (host_dev);
242246 }
243247
@@ -250,7 +254,6 @@ ContentRedirectionApiErrorType CRRemoveDeviceABI(const char *device_name, int *r
250254 }
251255
252256 if (!DevoptabTrampoline::RemoveDevoptab (device_name, resultOut)) {
253- *resultOut = -1 ;
254257 return CONTENT_REDIRECTION_API_ERROR_INVALID_ARG ;
255258 }
256259
You can’t perform that action at this time.
0 commit comments