some memory bugs from woodblock (thanks!)

This commit is contained in:
Dana Jansens 2002-07-03 05:26:11 +00:00
parent 75a068cca2
commit 9aaf4f8de7
2 changed files with 15 additions and 8 deletions

View file

@ -1303,6 +1303,7 @@ void BScreen::updateWorkArea(void) {
} }
xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal, xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal,
dims, 4 * workspacesList.size()); dims, 4 * workspacesList.size());
delete [] dims;
} else } else
xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal, xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal,
0, 0); 0, 0);

View file

@ -1225,9 +1225,12 @@ void BlackboxWindow::getMWMHints(void) {
num = PropMwmHintsElements; num = PropMwmHintsElements;
if (! xatom->getValue(client.window, XAtom::motif_wm_hints, if (! xatom->getValue(client.window, XAtom::motif_wm_hints,
XAtom::motif_wm_hints, num, XAtom::motif_wm_hints, num,
(unsigned long **)&mwm_hint) || (unsigned long **)&mwm_hint))
num < PropMwmHintsElements)
return; return;
if (num < PropMwmHintsElements) {
delete [] mwm_hint;
return;
}
if (mwm_hint->flags & MwmHintsDecorations) { if (mwm_hint->flags & MwmHintsDecorations) {
if (mwm_hint->decorations & MwmDecorAll) { if (mwm_hint->decorations & MwmDecorAll) {
@ -1268,7 +1271,7 @@ void BlackboxWindow::getMWMHints(void) {
functions |= Func_Close; functions |= Func_Close;
} }
} }
delete mwm_hint; delete [] mwm_hint;
} }
@ -1286,9 +1289,12 @@ bool BlackboxWindow::getBlackboxHints(void) {
num = PropBlackboxHintsElements; num = PropBlackboxHintsElements;
if (! xatom->getValue(client.window, XAtom::blackbox_hints, if (! xatom->getValue(client.window, XAtom::blackbox_hints,
XAtom::blackbox_hints, num, XAtom::blackbox_hints, num,
(unsigned long **)&blackbox_hint) || (unsigned long **)&blackbox_hint))
num < PropBlackboxHintsElements)
return False; return False;
if (num < PropBlackboxHintsElements) {
delete [] blackbox_hint;
return False;
}
if (blackbox_hint->flags & AttribShaded) if (blackbox_hint->flags & AttribShaded)
flags.shaded = (blackbox_hint->attrib & AttribShaded); flags.shaded = (blackbox_hint->attrib & AttribShaded);
@ -1350,7 +1356,7 @@ bool BlackboxWindow::getBlackboxHints(void) {
reconfigure(); reconfigure();
} }
delete blackbox_hint; delete [] blackbox_hint;
return True; return True;
} }
@ -2103,7 +2109,7 @@ void BlackboxWindow::restoreAttributes(void) {
(unsigned long **)&net)) (unsigned long **)&net))
return; return;
if (num < PropBlackboxAttributesElements) { if (num < PropBlackboxAttributesElements) {
delete net; delete [] net;
return; return;
} }
@ -2169,7 +2175,7 @@ void BlackboxWindow::restoreAttributes(void) {
// with the state set it will then be the map event's job to read the // with the state set it will then be the map event's job to read the
// window's state and behave accordingly // window's state and behave accordingly
delete net; delete [] net;
} }