Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
72e60dea
Commit
72e60dea
authored
May 12, 2016
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2563 from obscuren/rpcaddr-fix
eth: fixed double close of channel. Fixes #2555
parents
a5ff4878
7c1f7471
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
event.go
event/event.go
+3
-0
event_test.go
event/event_test.go
+8
-0
No files found.
event/event.go
View file @
72e60dea
...
...
@@ -66,6 +66,9 @@ func (mux *TypeMux) Subscribe(types ...interface{}) Subscription {
mux
.
mutex
.
Lock
()
defer
mux
.
mutex
.
Unlock
()
if
mux
.
stopped
{
// set the status to closed so that calling Unsubscribe after this
// call will short curuit
sub
.
closed
=
true
close
(
sub
.
postC
)
}
else
{
if
mux
.
subm
==
nil
{
...
...
event/event_test.go
View file @
72e60dea
...
...
@@ -25,6 +25,14 @@ import (
type
testEvent
int
func
TestSubCloseUnsub
(
t
*
testing
.
T
)
{
// the point of this test is **not** to panic
var
mux
TypeMux
mux
.
Stop
()
sub
:=
mux
.
Subscribe
(
int
(
0
))
sub
.
Unsubscribe
()
}
func
TestSub
(
t
*
testing
.
T
)
{
mux
:=
new
(
TypeMux
)
defer
mux
.
Stop
()
...
...
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