Audio: Fix stream not being unlocked on exception
This commit is contained in:
		
							parent
							
								
									99866fb84c
								
							
						
					
					
						commit
						01529c5741
					
				
					 1 changed files with 13 additions and 1 deletions
				
			
		| 
						 | 
					@ -1273,7 +1273,19 @@ struct AudioStream
 | 
				
			||||||
				stream.close();
 | 
									stream.close();
 | 
				
			||||||
		case ALStream::Closed :
 | 
							case ALStream::Closed :
 | 
				
			||||||
			if (diffFile)
 | 
								if (diffFile)
 | 
				
			||||||
				stream.open(filename);
 | 
								{
 | 
				
			||||||
 | 
									try
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										/* This will throw on errors while
 | 
				
			||||||
 | 
										 * opening the data source */
 | 
				
			||||||
 | 
										stream.open(filename);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									catch (const Exception &e)
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										unlockStream();
 | 
				
			||||||
 | 
										throw e;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue