Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. JS garbage collection in QWebFrame or QWebView.
Forum Updated to NodeBB v4.3 + New Features

JS garbage collection in QWebFrame or QWebView.

Scheduled Pinned Locked Moved Qt WebKit
3 Posts 2 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael
    wrote on last edited by
    #1

    Is it possible to trigger garbage collection in QWebFrame or QWebView somehow? I believe to do that I need to access QScriptEngine object instantiated in QWebFrame, and call its collectGarbage() method. But I cannot find any way to do that. Is it possible?

    Respectfully,
    Michael

    1 Reply Last reply
    0
    • P Offline
      P Offline
      prokher
      wrote on last edited by
      #2

      +1, is it possible?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        prokher
        wrote on last edited by
        #3

        Eventually,

        I've achieved this by patching Qt sources:
        @
        src/3rdparty/webkit/Source/WebKit/qt/Api/qwebframe.h
        src/3rdparty/webkit/Source/WebKit/qt/Api/qwebframe.cpp
        @

        I added two static methods to QWebFrame

        @
        void QWebFrame::collectGarbageNow() {
        gcController().garbageCollectNow();
        }

        void QWebFrame::collectGarbageSoon() {
        gcController().garbageCollectSoon();
        }
        @

        and looks like it works...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved