plugin: Don't leak CUDA load exceptions
This commit is contained in:
		
							parent
							
								
									d166a26d4c
								
							
						
					
					
						commit
						4b36c91fe8
					
				|  | @ -98,7 +98,12 @@ try { | ||||||
| 
 | 
 | ||||||
| #ifdef ENABLE_NVIDIA_CUDA | #ifdef ENABLE_NVIDIA_CUDA | ||||||
| 	// Initialize CUDA if features requested it.
 | 	// Initialize CUDA if features requested it.
 | ||||||
| 	auto cuda = ::streamfx::nvidia::cuda::obs::get(); | 	std::shared_ptr<::streamfx::nvidia::cuda::obs> cuda; | ||||||
|  | 	try { | ||||||
|  | 		cuda = ::streamfx::nvidia::cuda::obs::get(); | ||||||
|  | 	} catch (...) { | ||||||
|  | 		// If CUDA failed to load, it is considered safe to ignore.
 | ||||||
|  | 	} | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| 	// GS Stuff
 | 	// GS Stuff
 | ||||||
|  | @ -185,6 +190,9 @@ try { | ||||||
| 
 | 
 | ||||||
| 	DLOG_INFO("Loaded Version %s", STREAMFX_VERSION_STRING); | 	DLOG_INFO("Loaded Version %s", STREAMFX_VERSION_STRING); | ||||||
| 	return true; | 	return true; | ||||||
|  | } catch (std::exception const& ex) { | ||||||
|  | 	DLOG_ERROR("Unexpected exception in function '%s': %s", __FUNCTION_NAME__, ex.what()); | ||||||
|  | 	return false; | ||||||
| } catch (...) { | } catch (...) { | ||||||
| 	DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); | 	DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); | ||||||
| 	return false; | 	return false; | ||||||
|  | @ -274,6 +282,8 @@ try { | ||||||
| 	streamfx::configuration::finalize(); | 	streamfx::configuration::finalize(); | ||||||
| 
 | 
 | ||||||
| 	DLOG_INFO("Unloaded Version %s", STREAMFX_VERSION_STRING); | 	DLOG_INFO("Unloaded Version %s", STREAMFX_VERSION_STRING); | ||||||
|  | } catch (std::exception const& ex) { | ||||||
|  | 	DLOG_ERROR("Unexpected exception in function '%s': %s", __FUNCTION_NAME__, ex.what()); | ||||||
| } catch (...) { | } catch (...) { | ||||||
| 	DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); | 	DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue