mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Script: Fixed that SKIN:ParseFormula didn't work with numbers
NowPlaying.dll: Fixed a few TagLib memory leaks.
This commit is contained in:
parent
a57d75399c
commit
476eaf1679
@ -106,13 +106,14 @@ static int ParseFormula(lua_State* L)
|
||||
std::wstring strTmp = LuaManager::ToWide(L, 2);
|
||||
|
||||
double result;
|
||||
if (self->GetParser().ParseFormula(strTmp, &result))
|
||||
if (!self->GetParser().ParseFormula(strTmp, &result))
|
||||
{
|
||||
lua_pushnumber(L, result);
|
||||
return 1;
|
||||
result = lua_tonumber(L, 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
lua_pushnumber(L, result);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int MoveWindow(lua_State* L)
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "PlayerWinamp.h"
|
||||
#include "PlayerWLM.h"
|
||||
#include "PlayerWMP.h"
|
||||
#include "id3v1tag.h"
|
||||
|
||||
static std::vector<ParentMeasure*> g_ParentMeasures;
|
||||
std::wstring g_SettingsFile;
|
||||
@ -43,10 +42,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
// Disable DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls
|
||||
DisableThreadLibraryCalls(hinstDLL);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
TagLib::ID3v1::Tag::setStringHandler(NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -141,11 +141,19 @@ class ASF::File::HeaderExtensionObject : public ASF::File::BaseObject
|
||||
{
|
||||
public:
|
||||
List<ASF::File::BaseObject *> objects;
|
||||
~HeaderExtensionObject();
|
||||
ByteVector guid();
|
||||
void parse(ASF::File *file, uint size);
|
||||
ByteVector render(ASF::File *file);
|
||||
};
|
||||
|
||||
ASF::File::HeaderExtensionObject::~HeaderExtensionObject()
|
||||
{
|
||||
for(unsigned int i = 0; i < objects.size(); i++) {
|
||||
delete objects[i];
|
||||
}
|
||||
}
|
||||
|
||||
void ASF::File::BaseObject::parse(ASF::File *file, unsigned int size)
|
||||
{
|
||||
data.clear();
|
||||
|
@ -51,7 +51,8 @@ public:
|
||||
static const StringHandler *stringHandler;
|
||||
};
|
||||
|
||||
const ID3v1::StringHandler *ID3v1::Tag::TagPrivate::stringHandler = new StringHandler;
|
||||
static const StringHandler defaultStringHandler;
|
||||
const ID3v1::StringHandler *ID3v1::Tag::TagPrivate::stringHandler = &defaultStringHandler;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// StringHandler implementation
|
||||
@ -189,7 +190,9 @@ void ID3v1::Tag::setTrack(uint i)
|
||||
|
||||
void ID3v1::Tag::setStringHandler(const StringHandler *handler)
|
||||
{
|
||||
delete TagPrivate::stringHandler;
|
||||
if(TagPrivate::stringHandler != &defaultStringHandler)
|
||||
delete TagPrivate::stringHandler;
|
||||
|
||||
TagPrivate::stringHandler = handler;
|
||||
}
|
||||
|
||||
|
@ -73,9 +73,8 @@ FrameFactory *FrameFactory::factory = 0;
|
||||
|
||||
FrameFactory *FrameFactory::instance()
|
||||
{
|
||||
if(!factory)
|
||||
factory = new FrameFactory;
|
||||
return factory;
|
||||
static FrameFactory factory;
|
||||
return &factory;
|
||||
}
|
||||
|
||||
Frame *FrameFactory::createFrame(const ByteVector &data, bool synchSafeInts) const
|
||||
|
Loading…
Reference in New Issue
Block a user