Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
984aadb5
Commit
984aadb5
authored
Mar 21, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Update progress dialog on the main thread, make check thread safe
This should fix some crashes as reported by the users.
parent
56220f86
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
18 deletions
+13
-18
modules/gui/macosx/coredialogs.h
modules/gui/macosx/coredialogs.h
+2
-1
modules/gui/macosx/coredialogs.m
modules/gui/macosx/coredialogs.m
+7
-10
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+4
-7
No files found.
modules/gui/macosx/coredialogs.h
View file @
984aadb5
...
...
@@ -76,6 +76,8 @@
}
+
(
VLCCoreDialogProvider
*
)
sharedInstance
;
@property
(
atomic
,
readwrite
)
BOOL
progressCancelled
;
-
(
void
)
performEventWithObject
:
(
NSValue
*
)
o_value
ofType
:
(
const
char
*
)
type
;
-
(
void
)
showFatalDialog
:
(
NSValue
*
)
o_value
;
...
...
@@ -88,7 +90,6 @@
-
(
void
)
showProgressDialogOnMainThread
:
(
NSValue
*
)
o_value
;
-
(
void
)
showProgressDialog
:
(
NSValue
*
)
o_value
;
-
(
IBAction
)
progDialogAction
:(
id
)
sender
;
-
(
BOOL
)
progressCancelled
;
-
(
void
)
updateProgressPanelWithText
:
(
NSString
*
)
string
andNumber
:
(
double
)
d_number
;
-
(
void
)
destroyProgressPanel
;
...
...
modules/gui/macosx/coredialogs.m
View file @
984aadb5
...
...
@@ -36,6 +36,8 @@
static
VLCCoreDialogProvider
*
_o_sharedInstance
=
nil
;
@synthesize
progressCancelled
=
b_progress_cancelled
;
+
(
VLCCoreDialogProvider
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
...
...
@@ -153,10 +155,10 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
{
/* we work-around a Cocoa limitation here, since you cannot delay an execution
* on the main thread within a single call */
b_progress_cancelled
=
NO
;
[
self
setProgressCancelled
:
NO
]
;
dialog_progress_bar_t
*
p_dialog
=
[
o_value
pointerValue
];
if
(
!
p_dialog
||
b_progress_cancelled
)
if
(
!
p_dialog
)
return
;
[
o_prog_win
setTitle
:
toNSStr
(
p_dialog
->
title
)];
...
...
@@ -177,7 +179,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
{
dialog_progress_bar_t
*
p_dialog
=
[
o_value
pointerValue
];
if
(
!
p_dialog
||
b_progress_cancelled
)
if
(
!
p_dialog
||
[
self
progressCancelled
]
)
return
;
[
o_prog_bar
setDoubleValue
:
0
];
...
...
@@ -197,19 +199,14 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
-
(
void
)
destroyProgressPanel
{
b_progress_cancelled
=
YES
;
[
self
setProgressCancelled
:
YES
]
;
[
o_prog_bar
performSelectorOnMainThread
:
@selector
(
stopAnimation
:)
withObject
:
self
waitUntilDone
:
YES
];
[
o_prog_win
performSelectorOnMainThread
:
@selector
(
close
)
withObject
:
nil
waitUntilDone
:
YES
];
}
-
(
IBAction
)
progDialogAction
:(
id
)
sender
{
b_progress_cancelled
=
YES
;
}
-
(
BOOL
)
progressCancelled
{
return
b_progress_cancelled
;
[
self
setProgressCancelled
:
YES
];
}
-
(
id
)
errorPanel
...
...
modules/gui/macosx/intf.m
View file @
984aadb5
...
...
@@ -524,13 +524,10 @@ void updateProgressPanel (void *priv, const char *text, float value)
{
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSString
*
o_txt
;
if
(
text
!=
NULL
)
o_txt
=
[
NSString
stringWithUTF8String
:
text
];
else
o_txt
=
@""
;
NSString
*
o_txt
=
toNSStr
(
text
);
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[[[
VLCMain
sharedInstance
]
coreDialogProvider
]
updateProgressPanelWithText
:
o_txt
andNumber
:
(
double
)(
value
*
1000
.)];
});
[
o_pool
release
];
}
...
...
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