Fix a memory leak
This commit is contained in:
@@ -11,6 +11,7 @@ func TestCallback_001(t *testing.T) {
|
||||
if reflect.TypeOf(v) != reflect.TypeOf(TestCallback_001) {
|
||||
t.Error("Received unexpected value")
|
||||
}
|
||||
cbDelete(c)
|
||||
}
|
||||
|
||||
func TestCallback_002(t *testing.T) {
|
||||
@@ -21,3 +22,12 @@ func TestCallback_002(t *testing.T) {
|
||||
cbGet(c + 1)
|
||||
t.Error("Expected a panic")
|
||||
}
|
||||
|
||||
func TestCallback_003(t *testing.T) {
|
||||
defer func() {
|
||||
recover()
|
||||
}()
|
||||
c := cbAdd(TestCallback_003)
|
||||
cbDelete(c + 1)
|
||||
t.Error("Expected a panic")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user