diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm index c7aea7a06a6dc2..c0fecc8073c720 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm @@ -667,15 +667,13 @@ - (void)disconnect:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(nu - (void)purgeCache:(dispatch_queue_t _Nonnull)clientQueue responseHandler:(void (^)(MatterError * _Nonnull))responseHandler { - [self dispatchOnMatterSDKQueue:@"purgeCache(...)" - block:^{ - CHIP_ERROR err = CastingServer::GetInstance()->PurgeCache(); - dispatch_async(clientQueue, ^{ - responseHandler( - [[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }]; + dispatch_sync(_chipWorkQueue, ^{ + CHIP_ERROR err = CastingServer::GetInstance()->PurgeCache(); + dispatch_async(clientQueue, ^{ + responseHandler([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }); } - (void)contentLauncher_launchUrl:(ContentApp * _Nonnull)contentApp