Fixed an issue that TrayMeasure doesn't work with Measure=PLUGIN.

This commit is contained in:
spx 2010-12-08 02:46:41 +00:00
parent f0f7bd9121
commit 3324084c7f
2 changed files with 15 additions and 8 deletions

View File

@ -72,7 +72,12 @@ bool CMeasurePlugin::Update()
WCHAR buffer[MAX_PATH];
GetCurrentDirectory(MAX_PATH, buffer);
SetCurrentDirectory((Rainmeter->GetSkinPath() + m_MeterWindow->GetSkinName()).c_str());
std::wstring dir = Rainmeter->GetSkinPath();
if (m_MeterWindow)
{
dir += m_MeterWindow->GetSkinName();
}
SetCurrentDirectory(dir.c_str());
if(UpdateFunc)
{
@ -180,7 +185,12 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
WCHAR buffer[MAX_PATH];
GetCurrentDirectory(MAX_PATH, buffer);
SetCurrentDirectory((Rainmeter->GetSkinPath() + m_MeterWindow->GetSkinName()).c_str());
std::wstring dir = Rainmeter->GetSkinPath();
if (m_MeterWindow)
{
dir += m_MeterWindow->GetSkinName();
}
SetCurrentDirectory(dir.c_str());
// Remove current directory from DLL search path
CSystem::RmSetDllDirectory(L"");

View File

@ -92,8 +92,8 @@ CTrayWindow::~CTrayWindow()
KillTimer(m_Window, TRAYTIMER);
RemoveTrayIcon();
if (m_Bitmap) delete m_Bitmap;
if (m_Measure) delete m_Measure;
delete m_Bitmap;
delete m_Measure;
for (size_t i = 0; i < m_TrayIcons.size(); ++i)
{
@ -350,10 +350,7 @@ void CTrayWindow::ReadConfig(CConfigParser& parser)
if (m_TrayIcons.size() == 0)
{
// No icons found so load as bitmap
if (m_Bitmap)
{
delete m_Bitmap;
}
delete m_Bitmap;
m_Bitmap = new Bitmap(imageName.c_str());
Status status = m_Bitmap->GetLastStatus();
if(Ok != status)