Core Stop and Start: Fixed stop and start again by avoiding FreeLibrary() of the OpenGL plugin, and avoiding a crash in its ShutDown() function. You need to use SETUP_FREE_PLUGIN_ON_BOOT to compile with this option that works on my system. Also, I noticed that I don't need the SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG anymore, I can now delete the g_EmuThread without having it hanging in its waiting function.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2356 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-22 04:24:53 +00:00
parent 5057d3b446
commit fc6a7c47d5
10 changed files with 98 additions and 45 deletions

View File

@ -73,11 +73,19 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
// ---------------
ConfigDialog::~ConfigDialog()
{
Console::Print("ConfigDialog Closed\n");
}
void ConfigDialog::OnClose(wxCloseEvent& event)
{
// notice that we don't run wxEntryCleanup(); here so the dll will still be loaded
g_Config.Save();
Console::Print("OnClose\n");
// notice that we don't run wxEntryCleanup(); here so the dll will still be loaded
/* JP: Yes, it seems like Close() does not do that. It only runs EndModal() or something
similar to hide the window. And I don't understand the "Window deletion overview" on
the wxWidgets website. Destroy() doesn't run the destructor either. */
//wxEntryCleanup();
//EndModal(0);
// Allow wxWidgets to close and unload the window
@ -86,7 +94,13 @@ void ConfigDialog::OnClose(wxCloseEvent& event)
void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event))
{
Close();
Console::Print("CloseClick\n");
g_Config.Save();
wxEntryCleanup();
//Close();
}
///////////////////////////////

View File

@ -50,6 +50,7 @@
#include "XFBConvert.h"
#include "TextureConverter.h"
#include "OnScreenDisplay.h"
#include "Setup.h"
#include "VideoState.h"
///////////////////////////////////////////////
@ -96,8 +97,27 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
{
}
// This is used for the fuctions right below here, in DllConfig()
#if defined(HAVE_WX) && HAVE_WX
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
extern HINSTANCE g_hInstance;
#endif
void DllConfig(HWND _hParent)
{
#if defined(HAVE_WX) && HAVE_WX
// This is needed because now we use wxEntryCleanup() when closing the configuration window
if (!wxTheApp || !wxTheApp->CallOnInit())
{
wxSetInstance((HINSTANCE)g_hInstance);
int argc = 0;
char **argv = NULL;
wxEntryStart(argc, argv);
}
#endif
//Console::Open();
#if defined(_WIN32)
wxWindow *win = new wxWindow();
win->SetHWND((WXHWND)_hParent);
@ -205,6 +225,8 @@ void DllConfig(HWND _hParent)
void Initialize(void *init)
{
//Console::Open();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
g_VideoInitialize = *(_pVideoInitialize); // Create a shortcut to _pVideoInitialize that can also update it
@ -276,20 +298,29 @@ void Video_Prepare(void)
void Shutdown(void)
{
Fifo_Shutdown();
TextureConverter::Shutdown();
VertexLoaderManager::Shutdown();
VertexShaderCache::Shutdown();
VertexShaderManager::Shutdown();
PixelShaderManager::Shutdown();
PixelShaderCache::Shutdown();
VertexManager::Shutdown();
TextureMngr::Shutdown();
OpcodeDecoder_Shutdown();
Renderer::Shutdown();
OpenGL_Shutdown();
Fifo_Shutdown();
TextureConverter::Shutdown();
VertexLoaderManager::Shutdown();
VertexShaderCache::Shutdown();
VertexShaderManager::Shutdown();
PixelShaderManager::Shutdown();
PixelShaderCache::Shutdown();
VertexManager::Shutdown();
// This cause some kind of crash, at least in the Release build and with this setup option
// If there wasn't so little explanations and comments in this code I would be more interested
// in trying to fix this function, now I'll just leave it like this, because it works
#ifndef SETUP_FREE_PLUGIN_ON_BOOT
TextureMngr::Shutdown();
#endif
OpcodeDecoder_Shutdown();
Renderer::Shutdown();
OpenGL_Shutdown();
}
//////////////////////////////////////////////////////////////////////////////////////////
// Enter and exit the video loop
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Video_EnterLoop()
{
Fifo_EnterLoop(g_VideoInitialize);
@ -299,6 +330,8 @@ void Video_ExitLoop()
{
Fifo_ExitLoop();
}
/////////////////////////
void DebugLog(const char* _fmt, ...)
{