Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
ab3dce8b
Commit
ab3dce8b
authored
Mar 08, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: fix x11_display double free and leaks
parent
630dbe9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+12
-8
No files found.
modules/gui/qt4/qt4.cpp
View file @
ab3dce8b
...
...
@@ -293,15 +293,19 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
#ifdef Q_WS_X11
if
(
!
XInitThreads
()
)
return
VLC_EGENERIC
;
x11_display
=
var_CreateGetNonEmptyString
(
p_intf
,
"x11-display"
);
char
*
display
=
var_CreateGetNonEmptyString
(
p_intf
,
"x11-display"
);
Display
*
p_display
=
XOpenDisplay
(
x11_display
);
if
(
!
p_display
)
{
msg_Err
(
p_intf
,
"Could not connect to X server"
);
free
(
display
);
return
VLC_EGENERIC
;
}
XCloseDisplay
(
p_display
);
putenv
(
(
char
*
)
"XLIB_SKIP_ARGB_VISUALS=1"
);
#else
char
*
display
=
NULL
;
#endif
bool
busy
;
...
...
@@ -312,6 +316,7 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
if
(
busy
)
{
msg_Err
(
p_this
,
"cannot start Qt4 multiple times"
);
free
(
display
);
return
VLC_EGENERIC
;
}
...
...
@@ -327,11 +332,13 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
if
(
vlc_clone
(
&
p_sys
->
thread
,
Thread
,
p_intf
,
VLC_THREAD_PRIORITY_LOW
)
)
{
delete
p_sys
;
free
(
display
);
vlc_mutex_lock
(
&
one
.
lock
);
one
.
busy
=
false
;
vlc_mutex_unlock
(
&
one
.
lock
);
return
VLC_ENOMEM
;
}
x11_display
=
display
;
/* */
vlc_sem_wait
(
&
ready
);
...
...
@@ -369,13 +376,14 @@ static void Close( vlc_object_t *p_this )
QVLCApp
::
triggerQuit
();
vlc_join
(
p_sys
->
thread
,
NULL
);
#ifdef Q_WS_X11
free
(
x11_display
);
x11_display
=
NULL
;
#endif
delete
p_sys
;
vlc_mutex_lock
(
&
one
.
lock
);
one
.
busy
=
false
;
vlc_mutex_unlock
(
&
one
.
lock
);
#ifdef Q_WS_X11
free
(
x11_display
);
#endif
}
static
void
*
Thread
(
void
*
obj
)
...
...
@@ -503,11 +511,7 @@ static void *Thread( void *obj )
/* Destroy the MainInputManager */
MainInputManager
::
killInstance
();
/* Delete the application automatically */
#ifdef Q_WS_X11
free
(
x11_display
);
#endif
return
NULL
;
}
...
...
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