Fixed voice recording cancel.
This commit is contained in:
		
							parent
							
								
									616531b0d0
								
							
						
					
					
						commit
						4d40336be0
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -100,6 +100,10 @@ void Instance::start() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Instance::stop(Fn<void(Result&&)> callback) {
 | 
					void Instance::stop(Fn<void(Result&&)> callback) {
 | 
				
			||||||
	InvokeQueued(_inner.get(), [=] {
 | 
						InvokeQueued(_inner.get(), [=] {
 | 
				
			||||||
 | 
							if (!callback) {
 | 
				
			||||||
 | 
								_inner->stop();
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		_inner->stop([=](Result &&result) {
 | 
							_inner->stop([=](Result &&result) {
 | 
				
			||||||
			crl::on_main([=, result = std::move(result)]() mutable {
 | 
								crl::on_main([=, result = std::move(result)]() mutable {
 | 
				
			||||||
				callback(std::move(result));
 | 
									callback(std::move(result));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue