Firefox add-on problem

hi my add-on “stop-it” was updated to 1.8.56 i get this error

-- called in potentially dangerous manner
Warning: Authors of bootstrapped add-ons must take care to remove any added observers at shutdown.

bootstrap.js
35
36
37
reg: function () {
Services.obs.addObserver(observers[‘http-on-modify-request’], ‘http-on-modify-request’, false);
},

can someone help me to solve that?

I think this should work:

exports.onUnload = () => Services.obs.removeObserver(observers[‘http-on-modify-request’], ‘http-on-modify-request’, false);

Thanks Nilkas, so i have this:

reg: function () {
Services.obs.addObserver(observers[‘http-on-modify-request’], ‘http-on-modify-request’, false);
},
unreg: function () {
Services.obs.removeObserver(observers[‘http-on-modify-request’], ‘http-on-modify-request’);

do i have to replace unreg: function () { by exports.onUnload = () =>

?

thanks for your help

If you already have an unreg function, just call it in the onUnload handler