mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-07-08 06:12:11 +00:00
FIX: too much memory used by long topics
This commit is contained in:
parent
6dd726e168
commit
f930aa14ec
@ -116,6 +116,15 @@ function defineSlot(divId, placement, settings, isMobile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function destroySlot(divId) {
|
||||||
|
if (ads[divId] && window.googletag) {
|
||||||
|
window.googletag.cmd.push(function(){
|
||||||
|
window.googletag.destroySlots([ads[divId].ad]);
|
||||||
|
delete ads[divId];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function loadGoogle() {
|
function loadGoogle() {
|
||||||
if (_loaded) {
|
if (_loaded) {
|
||||||
return Ember.RSVP.resolve();
|
return Ember.RSVP.resolve();
|
||||||
@ -208,5 +217,9 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}.on('didInsertElement')
|
}.on('didInsertElement'),
|
||||||
|
|
||||||
|
cleanup: function() {
|
||||||
|
destroySlot(this.get('divId'));
|
||||||
|
}.on('willDestroyElement')
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user