exceptions
This commit is contained in:
@@ -35,21 +35,24 @@ void Dialog::Init()
|
|||||||
CString Driver;
|
CString Driver;
|
||||||
for( unsigned i = 0; g_pImpl == NULL && i < DriversToTry.size(); ++i )
|
for( unsigned i = 0; g_pImpl == NULL && i < DriversToTry.size(); ++i )
|
||||||
{
|
{
|
||||||
try {
|
Driver = DriversToTry[i];
|
||||||
Driver = DriversToTry[i];
|
|
||||||
|
|
||||||
#if defined(HAVE_DIALOG_WIN32)
|
#if defined(HAVE_DIALOG_WIN32)
|
||||||
if( !DriversToTry[i].CompareNoCase("Win32") ) g_pImpl = new DialogDriver_Win32;
|
if( !DriversToTry[i].CompareNoCase("Win32") ) g_pImpl = new DialogDriver_Win32;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_DIALOG_COCOA)
|
#if defined(HAVE_DIALOG_COCOA)
|
||||||
if( !DriversToTry[i].CompareNoCase("Cocoa") ) g_pImpl = new DialogDriver_Cocoa;
|
if( !DriversToTry[i].CompareNoCase("Cocoa") ) g_pImpl = new DialogDriver_Cocoa;
|
||||||
#endif
|
#endif
|
||||||
if( !DriversToTry[i].CompareNoCase("Null") ) g_pImpl = new DialogDriver_Null;
|
if( !DriversToTry[i].CompareNoCase("Null") ) g_pImpl = new DialogDriver_Null;
|
||||||
}
|
|
||||||
catch( const RageException &e )
|
if( g_pImpl == NULL )
|
||||||
|
continue;
|
||||||
|
CString sError = g_pImpl->Init();
|
||||||
|
if( sError != "" )
|
||||||
{
|
{
|
||||||
if( LOG )
|
if( LOG )
|
||||||
LOG->Info("Couldn't load driver %s: %s", DriversToTry[i].c_str(), e.what());
|
LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() );
|
||||||
|
SAFE_DELETE( g_pImpl );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public:
|
|||||||
virtual Dialog::Result AbortRetryIgnore( CString sMessage, CString ID ) { return Dialog::ignore; }
|
virtual Dialog::Result AbortRetryIgnore( CString sMessage, CString ID ) { return Dialog::ignore; }
|
||||||
virtual Dialog::Result RetryCancel( CString sMessage, CString ID ) { return Dialog::cancel; }
|
virtual Dialog::Result RetryCancel( CString sMessage, CString ID ) { return Dialog::cancel; }
|
||||||
|
|
||||||
|
virtual CString Init() { return ""; }
|
||||||
virtual ~DialogDriver() { }
|
virtual ~DialogDriver() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user