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
2d20c3d3
Commit
2d20c3d3
authored
Feb 11, 2012
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix host destructor call.
parent
ea6dc345
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
share/lua/intf/modules/host.lua
share/lua/intf/modules/host.lua
+10
-2
No files found.
share/lua/intf/modules/host.lua
View file @
2d20c3d3
...
@@ -319,7 +319,7 @@ function host()
...
@@ -319,7 +319,7 @@ function host()
local
function
destructor
(
h
)
local
function
destructor
(
h
)
for
_
,
client
in
pairs
(
clients
)
do
for
_
,
client
in
pairs
(
clients
)
do
client
:
send
(
"Shutting down
."
)
--client:send("Cleaning up
.")
if
client
.
type
==
client_type
.
net
if
client
.
type
==
client_type
.
net
or
client
.
type
==
client_type
.
telnet
then
or
client
.
type
==
client_type
.
telnet
then
if
client
.
wfd
~=
client
.
rfd
then
if
client
.
wfd
~=
client
.
rfd
then
...
@@ -336,6 +336,14 @@ function host()
...
@@ -336,6 +336,14 @@ function host()
end
end
end
end
if
setfenv
then
-- We're running Lua 5.1
-- See http://lua-users.org/wiki/HiddenFeatures for more info.
local
proxy
=
newproxy
(
true
)
getmetatable
(
proxy
).
__gc
=
destructor
destructor
=
proxy
end
-- the instance
-- the instance
local
h
=
setmetatable
(
local
h
=
setmetatable
(
{
-- data
{
-- data
...
@@ -348,7 +356,7 @@ function host()
...
@@ -348,7 +356,7 @@ function host()
broadcast
=
_broadcast
,
broadcast
=
_broadcast
,
},
},
{
-- metatable
{
-- metatable
__gc
=
destructor
,
__gc
=
destructor
,
-- Should work in Lua 5.2 without the new proxytrick as __gc is also called on tables (needs to be tested)
__metatable
=
""
,
__metatable
=
""
,
})
})
return
h
return
h
...
...
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