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
1512cf1a
Commit
1512cf1a
authored
Jun 25, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QPointer and QMutexLocker so we don't crash at Qt4 interface exit
parent
bd3008a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+25
-12
No files found.
modules/gui/qt4/qt4.cpp
View file @
1512cf1a
...
...
@@ -32,6 +32,7 @@
#include <QMutex>
#include <QMutexLocker>
#include <QWaitCondition>
#include <QPointer>
#include "qt4.hpp"
#include "dialogs_provider.hpp"
...
...
@@ -340,7 +341,7 @@ static void Init( intf_thread_t *p_intf )
p_mi->show(); */
p_intf
->
p_sys
->
b_isDialogProvider
=
false
;
val
.
p_address
=
p_intf
->
p_sys
->
p_mi
;
val
.
p_address
=
new
QPointer
<
MainInterface
>
(
p_intf
->
p_sys
->
p_mi
)
;
QMutexLocker
locker
(
&
windowLock
);
var_Set
(
p_intf
,
"window_widget"
,
val
);
windowWait
.
wakeAll
();
...
...
@@ -481,29 +482,41 @@ static int OpenWindow (vlc_object_t *obj)
windowWait
.
wait
(
&
windowLock
);
}
MainInterface
*
mi
=
(
MainInterface
*
)
ptrval
.
p_address
;
msg_Dbg
(
obj
,
"requesting window (%p)..."
,
mi
);
msg_Dbg
(
obj
,
"requesting window..."
);
QPointer
<
MainInterface
>
*
miP
=
(
QPointer
<
MainInterface
>
*
)
ptrval
.
p_address
;
ptrval
.
p_address
=
NULL
;
/* take ownership */
var_Set
(
intf
,
"window_widget"
,
ptrval
);
vlc_object_release
(
intf
);
if
(
miP
->
isNull
())
return
VLC_EGENERIC
;
wnd
->
handle
=
mi
->
requestVideo
(
wnd
->
vout
,
&
wnd
->
pos_x
,
&
wnd
->
pos_y
,
wnd
->
handle
=
(
*
miP
)
->
requestVideo
(
wnd
->
vout
,
&
wnd
->
pos_x
,
&
wnd
->
pos_y
,
&
wnd
->
width
,
&
wnd
->
height
);
windowLock
.
unlock
();
wnd
->
control
=
ControlWindow
;
wnd
->
p_private
=
intf
;
wnd
->
p_private
=
miP
;
return
VLC_SUCCESS
;
}
static
int
ControlWindow
(
vout_window_t
*
wnd
,
int
query
,
va_list
args
)
{
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
wnd
->
p_private
;
intf
->
p_sys
->
p_mi
->
controlVideo
(
wnd
->
handle
,
query
,
args
);
QPointer
<
MainInterface
>
*
miP
=
(
QPointer
<
MainInterface
>
*
)
wnd
->
p_private
;
QMutexLocker
locker
(
&
windowLock
);
if
(
miP
->
isNull
())
return
VLC_EGENERIC
;
return
(
*
miP
)
->
controlVideo
(
wnd
->
handle
,
query
,
args
);
}
static
void
CloseWindow
(
vlc_object_t
*
obj
)
{
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
obj
->
p_private
;
QPointer
<
MainInterface
>
*
miP
=
(
QPointer
<
MainInterface
>
*
)
wnd
->
p_private
;
QMutexLocker
locker
(
&
windowLock
);
intf
->
p_sys
->
p_mi
->
releaseVideo
(
wnd
->
handle
);
vlc_object_release
(
intf
);
if
(
!
miP
->
isNull
())
(
*
miP
)
->
releaseVideo
(
wnd
->
handle
);
delete
miP
;
}
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