mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- FolderInfo.dll: Fixed several memory leaks
- Changed FolderInfo and WebParser to import pcre_* functions from Rainmeter.dll to reduce binary size - Changed Help in context menu to open Support page (instead of Manual/Manual_beta)
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
#include <list>
|
||||
|
||||
namespace PluginFolderInfo {
|
||||
|
||||
|
||||
FolderInfo::FolderInfo(const wchar_t* aPath, const wchar_t* aIniPath)
|
||||
{
|
||||
mySubFolderFlag = false;
|
||||
@ -16,6 +16,11 @@ FolderInfo::FolderInfo(const wchar_t* aPath, const wchar_t* aIniPath)
|
||||
SetPath(aPath, aIniPath);
|
||||
}
|
||||
|
||||
FolderInfo::~FolderInfo()
|
||||
{
|
||||
FreePcre();
|
||||
}
|
||||
|
||||
void FolderInfo::Clear()
|
||||
{
|
||||
mySize = 0;
|
||||
@ -23,6 +28,19 @@ void FolderInfo::Clear()
|
||||
myFolderCount = 0;
|
||||
}
|
||||
|
||||
void FolderInfo::FreePcre()
|
||||
{
|
||||
if (myRegExpFilter) {
|
||||
pcre_free(myRegExpFilter);
|
||||
myRegExpFilter = NULL;
|
||||
}
|
||||
|
||||
if (myRegExpFilterExtra) {
|
||||
pcre_free(myRegExpFilterExtra);
|
||||
myRegExpFilterExtra = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void FolderInfo::SetPath(const wchar_t* aPath, const wchar_t* aIniPath)
|
||||
{
|
||||
if (!aPath || 0 == aPath[0]) {
|
||||
@ -122,11 +140,7 @@ void FolderInfo::CalculateSize()
|
||||
|
||||
void FolderInfo::SetRegExpFilter(const wchar_t* aFilter)
|
||||
{
|
||||
if (myRegExpFilter) {
|
||||
pcre_free(myRegExpFilter);
|
||||
myRegExpFilter = NULL;
|
||||
myRegExpFilterExtra = NULL;
|
||||
}
|
||||
FreePcre();
|
||||
|
||||
if (aFilter == NULL) {
|
||||
return;
|
||||
@ -144,6 +158,8 @@ void FolderInfo::SetRegExpFilter(const wchar_t* aFilter)
|
||||
if (myRegExpFilter) {
|
||||
myRegExpFilterExtra = pcre_study(myRegExpFilter, 0, &error);
|
||||
}
|
||||
|
||||
delete [] buf;
|
||||
}
|
||||
|
||||
} // namespace PluginFolderInfo
|
||||
|
Reference in New Issue
Block a user