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
7b2b08ec
Commit
7b2b08ec
authored
Sep 03, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout ios: fix autorelease pool leak on error (closes #15402)
parent
98ec14de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
153 additions
and
156 deletions
+153
-156
modules/video_output/ios2.m
modules/video_output/ios2.m
+153
-156
No files found.
modules/video_output/ios2.m
View file @
7b2b08ec
...
@@ -219,7 +219,6 @@ static int Open(vlc_object_t *this)
...
@@ -219,7 +219,6 @@ static int Open(vlc_object_t *this)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
vout_display_sys_t
*
sys
=
calloc
(
1
,
sizeof
(
*
sys
));
vout_display_sys_t
*
sys
=
calloc
(
1
,
sizeof
(
*
sys
));
NSAutoreleasePool
*
autoreleasePool
=
nil
;
if
(
!
sys
)
if
(
!
sys
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
...
@@ -228,8 +227,7 @@ static int Open(vlc_object_t *this)
...
@@ -228,8 +227,7 @@ static int Open(vlc_object_t *this)
sys
->
picturePool
=
NULL
;
sys
->
picturePool
=
NULL
;
sys
->
gl
.
sys
=
NULL
;
sys
->
gl
.
sys
=
NULL
;
autoreleasePool
=
[[
NSAutoreleasePool
alloc
]
init
];
@autoreleasepool
{
/* get the object we will draw into */
/* get the object we will draw into */
UIView
*
viewContainer
=
var_CreateGetAddress
(
vd
,
"drawable-nsobject"
);
UIView
*
viewContainer
=
var_CreateGetAddress
(
vd
,
"drawable-nsobject"
);
if
(
unlikely
(
viewContainer
==
nil
))
if
(
unlikely
(
viewContainer
==
nil
))
...
@@ -333,14 +331,12 @@ static int Open(vlc_object_t *this)
...
@@ -333,14 +331,12 @@ static int Open(vlc_object_t *this)
[
sys
->
glESView
performSelectorOnMainThread
:
@selector
(
reshape
)
[
sys
->
glESView
performSelectorOnMainThread
:
@selector
(
reshape
)
withObject:
nil
withObject:
nil
waitUntilDone:
YES
];
waitUntilDone:
YES
];
[
autoreleasePool
release
];
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
bailout:
bailout:
[
autoreleasePool
release
];
Close
(
this
);
Close
(
this
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
}
void
Close
(
vlc_object_t
*
this
)
void
Close
(
vlc_object_t
*
this
)
...
@@ -348,6 +344,7 @@ void Close (vlc_object_t *this)
...
@@ -348,6 +344,7 @@ void Close (vlc_object_t *this)
vout_display_t
*
vd
=
(
vout_display_t
*
)
this
;
vout_display_t
*
vd
=
(
vout_display_t
*
)
this
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
@autoreleasepool
{
if
(
sys
->
tapRecognizer
)
{
if
(
sys
->
tapRecognizer
)
{
[
sys
->
tapRecognizer
.
view
removeGestureRecognizer
:
sys
->
tapRecognizer
];
[
sys
->
tapRecognizer
.
view
removeGestureRecognizer
:
sys
->
tapRecognizer
];
[
sys
->
tapRecognizer
release
];
[
sys
->
tapRecognizer
release
];
...
@@ -377,6 +374,7 @@ void Close (vlc_object_t *this)
...
@@ -377,6 +374,7 @@ void Close (vlc_object_t *this)
}
}
free
(
sys
);
free
(
sys
);
}
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -400,12 +398,12 @@ static int Control(vout_display_t *vd, int query, va_list ap)
...
@@ -400,12 +398,12 @@ static int Control(vout_display_t *vd, int query, va_list ap)
if
(
!
vd
->
sys
)
if
(
!
vd
->
sys
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
NSAutoreleasePool
*
autoreleasePool
=
[[
NSAutoreleasePool
alloc
]
init
];
@autoreleasepool
{
const
vout_display_cfg_t
*
cfg
;
const
vout_display_cfg_t
*
cfg
;
const
video_format_t
*
source
;
const
video_format_t
*
source
;
if
(
query
==
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
||
query
==
VOUT_DISPLAY_CHANGE_SOURCE_CROP
)
{
if
(
query
==
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
||
query
==
VOUT_DISPLAY_CHANGE_SOURCE_CROP
)
{
source
=
(
const
video_format_t
*
)
va_arg
(
ap
,
const
video_format_t
*
);
source
=
(
const
video_format_t
*
)
va_arg
(
ap
,
const
video_format_t
*
);
cfg
=
vd
->
cfg
;
cfg
=
vd
->
cfg
;
}
else
{
}
else
{
...
@@ -436,8 +434,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
...
@@ -436,8 +434,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
// x / y are top left corner, but we need the lower left one
// x / y are top left corner, but we need the lower left one
if
(
query
!=
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
)
if
(
query
!=
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
)
glViewport
(
place
.
x
,
cfg_tmp
.
display
.
height
-
(
place
.
y
+
place
.
height
),
place
.
width
,
place
.
height
);
glViewport
(
place
.
x
,
cfg_tmp
.
display
.
height
-
(
place
.
y
+
place
.
height
),
place
.
width
,
place
.
height
);
}
[
autoreleasePool
release
];
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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