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
b51af0b1
Commit
b51af0b1
authored
May 24, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
May 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ieframe: Keep track of InternetExplore external references and use that to release document.
parent
d256bf4b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
6 deletions
+46
-6
ie.c
dlls/ieframe/ie.c
+39
-4
ieframe.h
dlls/ieframe/ieframe.h
+2
-0
iexplore.c
dlls/ieframe/iexplore.c
+5
-2
No files found.
dlls/ieframe/ie.c
View file @
b51af0b1
...
...
@@ -713,6 +713,31 @@ static inline InternetExplorer *impl_from_IExternalConnection(IExternalConnectio
return
CONTAINING_RECORD
(
iface
,
InternetExplorer
,
IExternalConnection_iface
);
}
/*
* Document may keep references to InternetExplorer object causing circular references.
* We keep track of external references and release the document object when all
* external references are released. A visible main window is also considered as
* an external reference.
*/
DWORD
release_extern_ref
(
InternetExplorer
*
This
,
BOOL
last_closes
)
{
LONG
ref
=
InterlockedDecrement
(
&
This
->
extern_ref
);
TRACE
(
"ref = %d
\n
"
,
ref
);
if
(
ref
)
return
ref
;
if
(
!
last_closes
)
{
WARN
(
"Last external connection released with FALSE last_closes.
\n
"
);
return
ref
;
}
if
(
This
->
doc_host
)
deactivate_document
(
&
This
->
doc_host
->
doc_host
);
return
ref
;
}
static
HRESULT
WINAPI
ExternalConnection_QueryInterface
(
IExternalConnection
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
InternetExplorer
*
This
=
impl_from_IExternalConnection
(
iface
);
...
...
@@ -734,16 +759,26 @@ static ULONG WINAPI ExternalConnection_Release(IExternalConnection *iface)
static
DWORD
WINAPI
ExternalConnection_AddConnection
(
IExternalConnection
*
iface
,
DWORD
extconn
,
DWORD
reserved
)
{
InternetExplorer
*
This
=
impl_from_IExternalConnection
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
2
;
TRACE
(
"(%p)->(%x %x)
\n
"
,
This
,
extconn
,
reserved
);
if
(
extconn
!=
EXTCONN_STRONG
)
return
0
;
return
InterlockedIncrement
(
&
This
->
extern_ref
);
}
static
DWORD
WINAPI
ExternalConnection_ReleaseConnection
(
IExternalConnection
*
iface
,
DWORD
extconn
,
DWORD
reserved
,
BOOL
fLastReleaseCloses
)
{
InternetExplorer
*
This
=
impl_from_IExternalConnection
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
1
;
TRACE
(
"(%p)->(%x %x %x)
\n
"
,
This
,
extconn
,
reserved
,
fLastReleaseCloses
);
if
(
extconn
!=
EXTCONN_STRONG
)
return
0
;
return
release_extern_ref
(
This
,
fLastReleaseCloses
);
}
static
const
IExternalConnectionVtbl
ExternalConnectionVtbl
=
{
...
...
dlls/ieframe/ieframe.h
View file @
b51af0b1
...
...
@@ -229,6 +229,7 @@ struct InternetExplorer {
HlinkFrame
hlink_frame
;
LONG
ref
;
LONG
extern_ref
;
HWND
frame_hwnd
;
HWND
status_hwnd
;
...
...
@@ -288,6 +289,7 @@ LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
void
InternetExplorer_WebBrowser_Init
(
InternetExplorer
*
)
DECLSPEC_HIDDEN
;
HRESULT
update_ie_statustext
(
InternetExplorer
*
,
LPCWSTR
)
DECLSPEC_HIDDEN
;
void
released_obj
(
void
)
DECLSPEC_HIDDEN
;
DWORD
release_extern_ref
(
InternetExplorer
*
,
BOOL
)
DECLSPEC_HIDDEN
;
void
register_iewindow_class
(
void
)
DECLSPEC_HIDDEN
;
void
unregister_iewindow_class
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/ieframe/iexplore.c
View file @
b51af0b1
...
...
@@ -669,10 +669,13 @@ static LRESULT WINAPI ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
return
0
;
case
WM_SHOWWINDOW
:
TRACE
(
"WM_SHOWWINDOW %lx
\n
"
,
wparam
);
if
(
wparam
)
if
(
wparam
)
{
IWebBrowser2_AddRef
(
&
This
->
IWebBrowser2_iface
);
else
InterlockedIncrement
(
&
This
->
extern_ref
);
}
else
{
release_extern_ref
(
This
,
TRUE
);
IWebBrowser2_Release
(
&
This
->
IWebBrowser2_iface
);
}
break
;
case
WM_DESTROY
:
return
iewnd_OnDestroy
(
This
);
...
...
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