Skip to content

Commit 85c2d68

Browse files
committed
Fix: #55 CEF 130: JS listening for IPC event fails after opening devtools
1 parent a50edef commit 85c2d68

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

cef/ipc_render.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ type ipcRenderProcess struct {
4646
waitChan *ipc.WaitChan
4747
}
4848

49-
func (m *ipcRenderProcess) clear(frameId string) {
50-
if m.ipcObject != nil {
51-
m.ipcObject.Free()
52-
m.ipcObject = nil
53-
}
54-
if m.onHandler != nil {
55-
if on, ok := m.onHandler[frameId]; ok {
56-
on.clear()
57-
delete(m.onHandler, frameId)
58-
}
59-
}
60-
}
61-
6249
// JS ipc.on 监听事件
6350
func (m *ipcOnHandler) jsOnEvent(name string, object *ICefV8Value, arguments *TCefV8ValueArray, retVal *ResultV8Value, exception *ResultString) (result bool) {
6451
var size int
@@ -802,10 +789,6 @@ func (m *ipcRenderProcess) jsExecuteGoSyncEventMessageReply(browser *ICefBrowser
802789

803790
// ipc
804791
func (m *ipcRenderProcess) makeIPC(frameId string, context *ICefV8Context) {
805-
if m.ipcObject != nil {
806-
// 刷新时释放掉
807-
m.clear(frameId)
808-
}
809792
// ipc emit
810793
m.emitHandler.handler = V8HandlerRef.New()
811794
m.emitHandler.handler.Execute(m.jsExecuteGoEvent)

0 commit comments

Comments
 (0)