Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
Tor Browser
Commits
16420888
Commit
16420888
authored
Oct 23, 1999
by
dp%netscape.com
Browse files
bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> r=dp
parent
038812ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/src/xpconnect/loader/mozJSComponentLoader.cpp
View file @
16420888
...
...
@@ -637,10 +637,10 @@ CreateJSComponentLoader(nsISupports *aOuter, const nsIID &iid, void **result)
return
NS_ERROR_NULL_POINTER
;
*
result
=
0
;
nsISupports
*
inst
=
0
;
mozJSComponentLoader
*
inst
;
if
(
iid
.
Equals
(
NS_GET_IID
(
nsIComponentLoader
)))
{
inst
=
(
nsISupports
*
)
new
mozJSComponentLoader
();
inst
=
new
mozJSComponentLoader
();
}
else
{
return
NS_ERROR_NO_INTERFACE
;
}
...
...
@@ -648,10 +648,12 @@ CreateJSComponentLoader(nsISupports *aOuter, const nsIID &iid, void **result)
if
(
!
inst
)
return
NS_ERROR_OUT_OF_MEMORY
;
NS_ADDREF
(
inst
);
// Stabilize
nsresult
rv
=
inst
->
QueryInterface
(
iid
,
result
);
if
(
NS_FAILED
(
rv
))
{
delete
in
st
;
}
NS_RELEASE
(
inst
);
// Destabilize and avoid leaks. Avoid calling
delete
<
in
terface pointer>
return
rv
;
}
...
...
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