Closed
Bug 177176
Opened 22 years ago
Closed 22 years ago
Registering and unregistering as app-startup observer behaves strange
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: pali, Assigned: dougt)
References
Details
Attachments
(1 file)
(deleted),
patch
|
dougt
:
review+
dveditz
:
superreview+
roc
:
approval+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016
I'm unable to register (and unregister) as app-startup observer in Category
Manager at other time than module registration (MozgestModule.registerSelf) in
mozilla 1.2b.
I've done this change:
http://www.mozdev.org/source/browse/optimoz/mozgestService/service/mozgest-service.js.diff?r1=1.1&r2=1.2
and tried to register from preference screen with code:
function setStartup(onStartup) {
const MOZGEST_CONTRACTID = "@optimoz.mozdev.org/mozgest;1";
const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
const nsICategoryManager = Components.interfaces.nsICategoryManager;
var catMan = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
if (onStartup) {
dump("*** Mozgest JS Service will be started on Startup\n");
catMan.addCategoryEntry("app-startup",
"Mozgest observing Startup",
MOZGEST_CONTRACTID,
true,
true);
}
else {
dump("*** Mozgest JS Service will NOT be started on Startup\n");
catMan.deleteCategoryEntry("app-startup",
MOZGEST_CONTRACTID,
true);
}
}
But this does niether register my JS service - see
http://www.mozdev.org/source/browse/optimoz/mozgestService/service/ - when
registered at module registration, nor does it unregister my service in case it
was not registered with module.
I didn't get any exception, nor JS error.
And I'm not sure if it's related, but the module does not reregister itself when
it is replaced with newer file, which it did in 1.0 - 1.2a.
Reproducible: Always
Steps to Reproduce:
Comment 1•22 years ago
|
||
Venkman is also unable to unregister its app-startup observer. It appears that
the code executes, and removes the observer for the duration of the session, but
the observer is never deleted from compreg.dat. The next time mozilla starts
up, the observer is still there. The code in question is
http://lxr.mozilla.org/mozilla/source/js/jsd/jsd_xpc.cpp#2323
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 2•22 years ago
|
||
Assignee | ||
Comment 3•22 years ago
|
||
Comment on attachment 104542 [details] [diff] [review]
fixes problem
r=rginda via email
Attachment #104542 -
Flags: review+
Comment 4•22 years ago
|
||
Comment on attachment 104542 [details] [diff] [review]
fixes problem
sr=dveditz
Attachment #104542 -
Flags: superreview+
Comment on attachment 104542 [details] [diff] [review]
fixes problem
a=roc+moz for trunk
Attachment #104542 -
Flags: approval+
Assignee | ||
Comment 6•22 years ago
|
||
fixed.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•