Last Comment Bug 738996 - Remove agnostic Hold/DropScriptObject nsContentUtils functions
: Remove agnostic Hold/DropScriptObject nsContentUtils functions
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
Mentors:
Depends on: 907364
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-24 15:51 PDT by :Ms2ger (⌚ UTC+1/+2)
Modified: 2013-08-20 13:04 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (14.00 KB, patch)
2012-03-24 15:51 PDT, :Ms2ger (⌚ UTC+1/+2)
mrbkap: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2012-03-24 15:51:12 PDT
Created attachment 609042 [details] [diff] [review]
Patch v1

There's some nice code removal to be done here.
Comment 1 Olli Pettay [:smaug] 2012-03-24 16:32:35 PDT
Peterv should probably look at the patch.
(It looks good to me.)
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-03-27 07:53:38 PDT
Peter, please let me know if you still need to review.
Comment 3 Peter Van der Beken [:peterv] - away till Aug 1st 2012-03-27 11:11:36 PDT
Comment on attachment 609042 [details] [diff] [review]
Patch v1

Review of attachment 609042 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/src/events/nsJSEventListener.cpp
@@ +86,5 @@
>    // until we are done with it.
>    NS_ASSERTION(aScopeObject && aContext,
>                 "EventListener with no context or scope?");
> +  nsContentUtils::HoldJSObjects(this,
> +                                &NS_CYCLE_COLLECTION_NAME(nsJSEventListener));

I think this needs to use NS_HOLD_JS_OBJECTS since you also use NS_DROP_JS_OBJECTS.

@@ +92,5 @@
>  
>  nsJSEventListener::~nsJSEventListener() 
>  {
> +  if (mContext) {
> +    nsContentUtils::DropJSObjects(this);

I think this needs to use NS_DROP_JS_OBJECTS.
Comment 4 :Ms2ger (⌚ UTC+1/+2) 2012-03-30 05:35:25 PDT
https://hg.mozilla.org/mozilla-central/rev/8f188d988941

Note You need to log in before you can comment on or make changes to this bug.