Answer the question
In order to leave comments, you need to log in
How to fix a memory leak when using the Vkontakte widget?
There is a site where content is loaded using ajax and history api.
The pages have VKontakte Wall Post widgets that are initialized as follows:
(function () {
if (!window.VK || !VK.Widgets || !VK.Widgets.Post || !VK.Widgets.Post("vk_post_-1111_111", - 1111 , 111 , 'hash',{redesign: 1}))setTimeout(arguments.callee, 50);
}());
<div id="vk_post_-1111_111"></div>
$('#vk_post_-1111_111').remove();
Answer the question
In order to leave comments, you need to log in
A friend about a year and a half ago was banging his head against the wall with this question.
The solution was simple - run the code inside the iframe, destroying the iframe, the memory is freed.
Have you tried just clearing window from VK? window is not cleaned up by the garbage collector.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question