Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
eb961873
Unverified
Commit
eb961873
authored
Dec 07, 2017
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-p/xquerytree_leak' into 3.6.x
Attributes GH PR #588:
https://github.com/ArcticaProject/nx-libs/pull/588
Fixes: ArcticaProject/nx-libs#585
parents
5487d52f
ad53af09
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
25 deletions
+26
-25
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+18
-13
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+2
-3
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+6
-9
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
eb961873
...
@@ -417,6 +417,8 @@ void nxagentRemoteWindowInfo(Window win, int indent, Bool newLine)
...
@@ -417,6 +417,8 @@ void nxagentRemoteWindowInfo(Window win, int indent, Bool newLine)
}
}
}
}
#ifdef DEBUG_TREE
/*
/*
* Walk remote windows tree.
* Walk remote windows tree.
*/
*/
...
@@ -426,13 +428,12 @@ void nxagentRemoteWindowsTree(Window window, int level)
...
@@ -426,13 +428,12 @@ void nxagentRemoteWindowsTree(Window window, int level)
int
i
,
j
;
int
i
,
j
;
unsigned
long
rootWin
,
parentWin
;
unsigned
long
rootWin
,
parentWin
;
unsigned
int
numChildren
;
unsigned
int
numChildren
;
unsigned
long
*
childList
;
unsigned
long
*
childList
=
NULL
;
if
(
!
XQueryTree
(
nxagentDisplay
,
window
,
&
rootWin
,
&
parentWin
,
&
childList
,
if
(
!
XQueryTree
(
nxagentDisplay
,
window
,
&
rootWin
,
&
parentWin
,
&
childList
,
&
numChildren
))
&
numChildren
))
{
{
fprintf
(
stderr
,
"nxagentRemoteWindowsTree - XQueryTree failed.
\n
"
);
fprintf
(
stderr
,
"nxagentRemoteWindowsTree - XQueryTree failed.
\n
"
);
return
;
return
;
}
}
...
@@ -481,6 +482,7 @@ void nxagentRemoteWindowsTree(Window window, int level)
...
@@ -481,6 +482,7 @@ void nxagentRemoteWindowsTree(Window window, int level)
XFree
((
char
*
)
childList
);
XFree
((
char
*
)
childList
);
}
}
}
}
#endif
/*
/*
* Print info about internal window.
* Print info about internal window.
...
@@ -3185,7 +3187,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
...
@@ -3185,7 +3187,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
#endif
#endif
}
}
if
(
result
&&
n
children_return
)
if
(
children_return
)
{
{
XFree
(
children_return
);
XFree
(
children_return
);
}
}
...
@@ -3540,6 +3542,12 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3540,6 +3542,12 @@ int nxagentHandleReparentNotify(XEvent* X)
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
root_return
,
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
root_return
,
&
parent_return
,
&
children_return
,
&
nchildren_return
);
&
parent_return
,
&
children_return
,
&
nchildren_return
);
if
(
children_return
)
{
XFree
(
children_return
);
children_return
=
NULL
;
}
if
(
!
result
)
if
(
!
result
)
{
{
#ifdef WARNING
#ifdef WARNING
...
@@ -3548,11 +3556,6 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3548,11 +3556,6 @@ int nxagentHandleReparentNotify(XEvent* X)
break
;
break
;
}
}
if
(
result
&&
children_return
)
{
XFree
(
children_return
);
}
}
}
if
(
w
&&
!
nxagentWindowPtr
(
w
))
if
(
w
&&
!
nxagentWindowPtr
(
w
))
...
@@ -3581,9 +3584,10 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3581,9 +3584,10 @@ int nxagentHandleReparentNotify(XEvent* X)
#endif
#endif
}
}
if
(
result
&&
n
children_return
)
if
(
children_return
)
{
{
XFree
(
children_return
);
XFree
(
children_return
);
children_return
=
NULL
;
}
}
}
}
else
else
...
@@ -3648,14 +3652,15 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3648,14 +3652,15 @@ int nxagentHandleReparentNotify(XEvent* X)
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
rootReturn
,
&
parentReturn
,
result
=
XQueryTree
(
nxagentDisplay
,
w
,
&
rootReturn
,
&
parentReturn
,
&
childrenReturn
,
&
nchildrenReturn
);
&
childrenReturn
,
&
nchildrenReturn
);
if
(
parentReturn
==
rootReturn
||
parentReturn
==
0
||
result
==
0
)
if
(
childrenReturn
)
{
{
break
;
XFree
(
childrenReturn
);
childrenReturn
=
NULL
;
}
}
if
(
result
==
1
&&
childrenReturn
!=
NULL
)
if
(
parentReturn
==
rootReturn
||
parentReturn
==
0
||
result
==
0
)
{
{
XFree
(
childrenReturn
)
;
break
;
}
}
w
=
parentReturn
;
w
=
parentReturn
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
eb961873
...
@@ -249,9 +249,8 @@ Bool nxagentRootlessTreesMatch()
...
@@ -249,9 +249,8 @@ Bool nxagentRootlessTreesMatch()
{
{
Window
root_return
;
Window
root_return
;
Window
parent_return
;
Window
parent_return
;
Window
*
children_return
;
Window
*
children_return
=
NULL
;
unsigned
int
nChildrenReturn
;
unsigned
int
nChildrenReturn
;
WindowPtr
pW
;
WindowPtr
pTestWin
=
screenInfo
.
screens
[
0
]
->
root
->
firstChild
;
WindowPtr
pTestWin
=
screenInfo
.
screens
[
0
]
->
root
->
firstChild
;
Bool
treesMatch
=
True
;
Bool
treesMatch
=
True
;
Status
result
;
Status
result
;
...
@@ -270,7 +269,7 @@ Bool nxagentRootlessTreesMatch()
...
@@ -270,7 +269,7 @@ Bool nxagentRootlessTreesMatch()
while
(
nChildrenReturn
>
0
)
while
(
nChildrenReturn
>
0
)
{
{
pW
=
nxagentWindowPtr
(
children_return
[
--
nChildrenReturn
]);
WindowPtr
pW
=
nxagentWindowPtr
(
children_return
[
--
nChildrenReturn
]);
if
(
!
pW
)
if
(
!
pW
)
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
eb961873
...
@@ -1454,9 +1454,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
...
@@ -1454,9 +1454,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
{
{
Window
root_return
;
Window
root_return
;
Window
parent_return
;
Window
parent_return
;
Window
*
children_return
;
Window
*
children_return
=
NULL
;
unsigned
int
nchildren_return
;
unsigned
int
nchildren_return
;
Window
*
pw
;
Status
result
;
Status
result
;
result
=
XQueryTree
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
result
=
XQueryTree
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
...
@@ -1464,8 +1463,6 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
...
@@ -1464,8 +1463,6 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
if
(
result
)
if
(
result
)
{
{
pw
=
children_return
;
fprintf
(
stderr
,
"nxagentConfigureWindow: Children of the root: "
);
fprintf
(
stderr
,
"nxagentConfigureWindow: Children of the root: "
);
while
(
nchildren_return
>
0
)
while
(
nchildren_return
>
0
)
{
{
...
@@ -1476,16 +1473,16 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
...
@@ -1476,16 +1473,16 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
}
}
}
}
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
if
(
children_return
)
{
XFree
(
children_return
);
}
}
}
else
else
{
{
fprintf
(
stderr
,
"nxagentConfigureWindow: Failed QueryTree request.
\n
"
);
fprintf
(
stderr
,
"nxagentConfigureWindow: Failed QueryTree request.
\n
"
);
}
}
if
(
children_return
)
{
XFree
(
children_return
);
}
}
}
#endif
#endif
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment