Try to close the other modules correctly if a single one fails to close ( on program shutdown)
This commit is contained in:
1 parent
a92353c9a2
commit
79bbcbdccb
1 file changed
+98
-1
+98
-1
@@ -285,23 +285,120 @@ namespace Vocaluxe
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
CController.Close();
|
CController.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CController)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CVocaluxeServer.Close();
|
CVocaluxeServer.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CVocaluxeServer)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CGraphics.Close();
|
CGraphics.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CGraphics)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CThemes.Close();
|
CThemes.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CThemes)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CCover.Close();
|
CCover.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CCover)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CFonts.Close();
|
CFonts.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CFonts)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CBackgroundMusic.Close();
|
CBackgroundMusic.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CBackgroundMusic)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CWebcam.Close();
|
CWebcam.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CWebcam)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CDataBase.Close();
|
CDataBase.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CDataBase)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CVideo.Close();
|
CVideo.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CVideo)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CRecord.Close();
|
CRecord.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CRecord)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CSound.Close();
|
CSound.Close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CLog.LogError("Error during shutdown! (CSound)", false, false, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CDraw.Close();
|
CDraw.Close();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CLog.LogError("Error during shutdown!", false, false, e);
|
CLog.LogError("Error during shutdown! (CDraw)", false, false, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
GC.Collect(); // Do a GC run here before we close logs to have finalizers run
|
GC.Collect(); // Do a GC run here before we close logs to have finalizers run
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user