Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
039a9a5a
Commit
039a9a5a
authored
Apr 05, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Detach also internal listeners in detach_events.
parent
8791ce15
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
20 deletions
+32
-20
htmldoc.c
dlls/mshtml/htmldoc.c
+0
-2
htmlevent.c
dlls/mshtml/htmlevent.c
+4
-3
nsevents.c
dlls/mshtml/nsevents.c
+28
-15
No files found.
dlls/mshtml/htmldoc.c
View file @
039a9a5a
...
@@ -2046,8 +2046,6 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
...
@@ -2046,8 +2046,6 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
detach_events
(
This
);
detach_events
(
This
);
if
(
This
->
body_event_target
)
if
(
This
->
body_event_target
)
release_event_target
(
This
->
body_event_target
);
release_event_target
(
This
->
body_event_target
);
if
(
This
->
nsevent_listener
)
release_nsevents
(
This
);
if
(
This
->
catmgr
)
if
(
This
->
catmgr
)
ICatInformation_Release
(
This
->
catmgr
);
ICatInformation_Release
(
This
->
catmgr
);
...
...
dlls/mshtml/htmlevent.c
View file @
039a9a5a
...
@@ -1191,15 +1191,16 @@ static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *eve
...
@@ -1191,15 +1191,16 @@ static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *eve
void
detach_events
(
HTMLDocumentNode
*
doc
)
void
detach_events
(
HTMLDocumentNode
*
doc
)
{
{
if
(
doc
->
event_vector
)
{
int
i
;
int
i
;
if
(
!
doc
->
event_vector
)
return
;
for
(
i
=
0
;
i
<
EVENTID_LAST
;
i
++
)
{
for
(
i
=
0
;
i
<
EVENTID_LAST
;
i
++
)
{
if
(
doc
->
event_vector
[
i
])
if
(
doc
->
event_vector
[
i
])
detach_nsevent
(
doc
,
event_info
[
i
].
name
);
detach_nsevent
(
doc
,
event_info
[
i
].
name
);
}
}
}
release_nsevents
(
doc
);
}
}
...
...
dlls/mshtml/nsevents.c
View file @
039a9a5a
...
@@ -37,6 +37,11 @@
...
@@ -37,6 +37,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
static
const
PRUnichar
blurW
[]
=
{
'b'
,
'l'
,
'u'
,
'r'
,
0
};
static
const
PRUnichar
focusW
[]
=
{
'f'
,
'o'
,
'c'
,
'u'
,
's'
,
0
};
static
const
PRUnichar
keypressW
[]
=
{
'k'
,
'e'
,
'y'
,
'p'
,
'r'
,
'e'
,
's'
,
's'
,
0
};
static
const
PRUnichar
loadW
[]
=
{
'l'
,
'o'
,
'a'
,
'd'
,
0
};
typedef
struct
{
typedef
struct
{
nsIDOMEventListener
nsIDOMEventListener_iface
;
nsIDOMEventListener
nsIDOMEventListener_iface
;
nsDocumentEventListener
*
This
;
nsDocumentEventListener
*
This
;
...
@@ -363,7 +368,7 @@ void add_nsevent_listener(HTMLDocumentNode *doc, nsIDOMNode *nsnode, LPCWSTR typ
...
@@ -363,7 +368,7 @@ void add_nsevent_listener(HTMLDocumentNode *doc, nsIDOMNode *nsnode, LPCWSTR typ
nsIDOMEventTarget_Release
(
target
);
nsIDOMEventTarget_Release
(
target
);
}
}
void
detach_nsevent
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
typ
e
)
static
void
detach_nslistener
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
type
,
nsEventListener
*
listener
,
cpp_bool
is_captur
e
)
{
{
nsIDOMEventTarget
*
target
;
nsIDOMEventTarget
*
target
;
nsAString
type_str
;
nsAString
type_str
;
...
@@ -380,22 +385,35 @@ void detach_nsevent(HTMLDocumentNode *doc, const WCHAR *type)
...
@@ -380,22 +385,35 @@ void detach_nsevent(HTMLDocumentNode *doc, const WCHAR *type)
nsAString_InitDepend
(
&
type_str
,
type
);
nsAString_InitDepend
(
&
type_str
,
type
);
nsres
=
nsIDOMEventTarget_RemoveEventListener
(
target
,
&
type_str
,
nsres
=
nsIDOMEventTarget_RemoveEventListener
(
target
,
&
type_str
,
&
doc
->
nsevent_listener
->
htmlevent_listener
.
nsIDOMEventListener_iface
,
TRUE
);
&
listener
->
nsIDOMEventListener_iface
,
is_capture
);
nsAString_Finish
(
&
type_str
);
nsAString_Finish
(
&
type_str
);
nsIDOMEventTarget_Release
(
target
);
nsIDOMEventTarget_Release
(
target
);
if
(
NS_FAILED
(
nsres
))
if
(
NS_FAILED
(
nsres
))
ERR
(
"RemoveEventTarget failed: %08x
\n
"
,
nsres
);
ERR
(
"RemoveEventTarget failed: %08x
\n
"
,
nsres
);
}
}
void
detach_nsevent
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
type
)
{
detach_nslistener
(
doc
,
type
,
&
doc
->
nsevent_listener
->
htmlevent_listener
,
TRUE
);
}
void
release_nsevents
(
HTMLDocumentNode
*
doc
)
void
release_nsevents
(
HTMLDocumentNode
*
doc
)
{
{
nsDocumentEventListener
*
listener
=
doc
->
nsevent_listener
;
TRACE
(
"%p %p
\n
"
,
doc
,
doc
->
nsevent_listener
);
TRACE
(
"%p %p
\n
"
,
doc
,
doc
->
nsevent_listener
);
if
(
doc
->
nsevent_listener
)
{
if
(
!
listener
)
doc
->
nsevent_listener
->
doc
=
NULL
;
return
;
release_listener
(
doc
->
nsevent_listener
);
detach_nslistener
(
doc
,
blurW
,
&
listener
->
blur_listener
,
TRUE
);
detach_nslistener
(
doc
,
focusW
,
&
listener
->
focus_listener
,
TRUE
);
detach_nslistener
(
doc
,
keypressW
,
&
listener
->
keypress_listener
,
FALSE
);
detach_nslistener
(
doc
,
loadW
,
&
listener
->
load_listener
,
TRUE
);
listener
->
doc
=
NULL
;
release_listener
(
listener
);
doc
->
nsevent_listener
=
NULL
;
doc
->
nsevent_listener
=
NULL
;
}
}
}
void
init_nsevents
(
HTMLDocumentNode
*
doc
)
void
init_nsevents
(
HTMLDocumentNode
*
doc
)
...
@@ -404,11 +422,6 @@ void init_nsevents(HTMLDocumentNode *doc)
...
@@ -404,11 +422,6 @@ void init_nsevents(HTMLDocumentNode *doc)
nsIDOMEventTarget
*
target
;
nsIDOMEventTarget
*
target
;
nsresult
nsres
;
nsresult
nsres
;
static
const
PRUnichar
wsz_blur
[]
=
{
'b'
,
'l'
,
'u'
,
'r'
,
0
};
static
const
PRUnichar
wsz_focus
[]
=
{
'f'
,
'o'
,
'c'
,
'u'
,
's'
,
0
};
static
const
PRUnichar
wsz_keypress
[]
=
{
'k'
,
'e'
,
'y'
,
'p'
,
'r'
,
'e'
,
's'
,
's'
,
0
};
static
const
PRUnichar
wsz_load
[]
=
{
'l'
,
'o'
,
'a'
,
'd'
,
0
};
listener
=
heap_alloc
(
sizeof
(
nsDocumentEventListener
));
listener
=
heap_alloc
(
sizeof
(
nsDocumentEventListener
));
if
(
!
listener
)
if
(
!
listener
)
return
;
return
;
...
@@ -432,10 +445,10 @@ void init_nsevents(HTMLDocumentNode *doc)
...
@@ -432,10 +445,10 @@ void init_nsevents(HTMLDocumentNode *doc)
return
;
return
;
}
}
init_event
(
target
,
wsz_blur
,
&
listener
->
blur_listener
.
nsIDOMEventListener_iface
,
TRUE
);
init_event
(
target
,
blurW
,
&
listener
->
blur_listener
.
nsIDOMEventListener_iface
,
TRUE
);
init_event
(
target
,
wsz_focus
,
&
listener
->
focus_listener
.
nsIDOMEventListener_iface
,
TRUE
);
init_event
(
target
,
focusW
,
&
listener
->
focus_listener
.
nsIDOMEventListener_iface
,
TRUE
);
init_event
(
target
,
wsz_keypress
,
&
listener
->
keypress_listener
.
nsIDOMEventListener_iface
,
FALSE
);
init_event
(
target
,
keypressW
,
&
listener
->
keypress_listener
.
nsIDOMEventListener_iface
,
FALSE
);
init_event
(
target
,
wsz_load
,
&
listener
->
load_listener
.
nsIDOMEventListener_iface
,
TRUE
);
init_event
(
target
,
loadW
,
&
listener
->
load_listener
.
nsIDOMEventListener_iface
,
TRUE
);
nsIDOMEventTarget_Release
(
target
);
nsIDOMEventTarget_Release
(
target
);
}
}
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