Rename destroctor
This commit is contained in:
parent
b6e198af18
commit
80eb0b3cce
3 changed files with 12 additions and 3 deletions
|
@ -28,7 +28,10 @@ Atoms atoms_create(Display *const dpy)
|
|||
return atoms;
|
||||
}
|
||||
|
||||
void atoms_destroy(Atoms atoms)
|
||||
void atoms_delete(Atoms atoms)
|
||||
{
|
||||
// TODO: maybe we should assert
|
||||
if (atoms == NULL) return;
|
||||
|
||||
free(atoms);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
#ifndef _ATOMS_H
|
||||
#define _ATOMS_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#define ATOMS_DELETE(atoms) { \
|
||||
atoms_delete(atoms); \
|
||||
atoms = NULL; \
|
||||
}
|
||||
|
||||
/* EWMH atoms */
|
||||
enum {
|
||||
NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||
|
@ -18,6 +24,6 @@ typedef struct Atoms {
|
|||
} *Atoms;
|
||||
|
||||
Atoms atoms_create(Display *dpy);
|
||||
void atoms_destroy(Atoms atoms);
|
||||
void atoms_delete(Atoms atoms);
|
||||
|
||||
#endif // _ATOMS_H
|
||||
|
|
|
@ -545,7 +545,7 @@ void cleanup()
|
|||
free(scheme[i]);
|
||||
}
|
||||
|
||||
atoms_destroy(atoms);
|
||||
ATOMS_DELETE(atoms);
|
||||
XDestroyWindow(dpy, wmcheckwin);
|
||||
drw_free(drw);
|
||||
XSync(dpy, False);
|
||||
|
|
Loading…
Reference in a new issue