mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-26 01:15:52 +01:00
Removed temporary allocation to build a path that is actually a constant
This allocation was certainly participating to memory fragmentation.
This commit is contained in:
committed by
Carlos R. Mafra
parent
7c320447fb
commit
f73ccae798
@@ -1450,15 +1450,9 @@ static void buildMenuFromPL(_Panel * panel, WMPropList * pl)
|
|||||||
static WMPropList *getDefaultMenu(_Panel * panel)
|
static WMPropList *getDefaultMenu(_Panel * panel)
|
||||||
{
|
{
|
||||||
WMPropList *menu;
|
WMPropList *menu;
|
||||||
char *menuPath, *gspath;
|
static const char menuPath[] = WMAKER_RESOURCE_PATH "/plmenu";
|
||||||
|
|
||||||
gspath = wstrdup(WMAKER_RESOURCE_PATH);
|
|
||||||
|
|
||||||
menuPath = wmalloc(strlen(gspath) + 128);
|
|
||||||
sprintf(menuPath, "%s/plmenu", gspath);
|
|
||||||
|
|
||||||
menu = WMReadPropListFromFile(menuPath);
|
menu = WMReadPropListFromFile(menuPath);
|
||||||
|
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
char *buffer, *msg;
|
char *buffer, *msg;
|
||||||
|
|
||||||
@@ -1470,9 +1464,6 @@ static WMPropList *getDefaultMenu(_Panel * panel)
|
|||||||
wfree(buffer);
|
wfree(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
wfree(gspath);
|
|
||||||
wfree(menuPath);
|
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user