Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
04fcd4d5
Commit
04fcd4d5
authored
May 31, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
memory leak in REP socket fixed
parent
8408ae06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
30 deletions
+4
-30
rep.cpp
src/rep.cpp
+4
-30
No files found.
src/rep.cpp
View file @
04fcd4d5
...
...
@@ -66,27 +66,14 @@ void zmq::rep_t::xdetach_inpipe (class reader_t *pipe_)
in_pipes_t
::
size_type
index
=
in_pipes
.
index
(
pipe_
);
// If corresponding outpipe is still in place simply nullify the pointer
// to the inpipe and move it to the passive state.
if
(
out_pipes
[
index
])
{
in_pipes
[
index
]
=
NULL
;
if
(
in_pipes
.
index
(
pipe_
)
<
active
)
{
active
--
;
in_pipes
.
swap
(
index
,
active
);
out_pipes
.
swap
(
index
,
active
);
if
(
current
==
active
)
current
=
0
;
}
return
;
}
// Now both inpipe and outpipe are detached. Remove them from the lists.
if
(
index
<
active
)
{
active
--
;
if
(
current
==
active
)
current
=
0
;
}
if
(
out_pipes
[
index
])
out_pipes
[
index
]
->
term
();
in_pipes
.
erase
(
index
);
out_pipes
.
erase
(
index
);
}
...
...
@@ -104,27 +91,14 @@ void zmq::rep_t::xdetach_outpipe (class writer_t *pipe_)
if
(
sending_reply
&&
pipe_
==
reply_pipe
)
reply_pipe
=
NULL
;
// If corresponding inpipe is still in place simply nullify the pointer
// to the outpipe.
if
(
in_pipes
[
index
])
{
out_pipes
[
index
]
=
NULL
;
if
(
out_pipes
.
index
(
pipe_
)
<
active
)
{
active
--
;
in_pipes
.
swap
(
index
,
active
);
out_pipes
.
swap
(
index
,
active
);
if
(
current
==
active
)
current
=
0
;
}
return
;
}
// Now both inpipe and outpipe are detached. Remove them from the lists.
if
(
out_pipes
.
index
(
pipe_
)
<
active
)
{
active
--
;
if
(
current
==
active
)
current
=
0
;
}
if
(
in_pipes
[
index
])
in_pipes
[
index
]
->
term
();
in_pipes
.
erase
(
index
);
out_pipes
.
erase
(
index
);
}
...
...
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