fixed some segfault and memleak
git-svn-id: http://tint2.googlecode.com/svn/trunk@195 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -180,7 +180,7 @@ int init_net()
|
||||
int actual_format;
|
||||
unsigned long nitems;
|
||||
unsigned long bytes_after;
|
||||
unsigned char *prop;
|
||||
unsigned char *prop = 0;
|
||||
int pid;
|
||||
|
||||
_NET_WM_PID = XInternAtom(server.dsp, "_NET_WM_PID", True);
|
||||
@@ -189,7 +189,7 @@ int init_net()
|
||||
int ret = XGetWindowProperty(server.dsp, win, _NET_WM_PID, 0, 1024, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop);
|
||||
|
||||
fprintf(stderr, "tint2 : another systray is running");
|
||||
if (ret == 0) {
|
||||
if (ret == Success && prop) {
|
||||
pid = prop[1] * 256;
|
||||
pid += prop[0];
|
||||
fprintf(stderr, " pid=%d", pid);
|
||||
|
||||
Reference in New Issue
Block a user