Code Monkey home page Code Monkey logo

Comments (6)

harvimt avatar harvimt commented on June 17, 2024

Looks like the QApplication object keeps a reference to the QTimer objects.

I'm not sure what to do about this. We could re-user the QTimer objects, but it still seems like a good idea to be able to destroy them.

There's some discussion on these issues here: http://enki-editor.org/2014/08/23/Pyqt_mem_mgmt.html

I may have to subclass or wrap QTimer in some way so we're not using a closure as a slot. (or we may have to use QBasicTimer instead of QTimer

from quamash.

harvimt avatar harvimt commented on June 17, 2024

I looks like migrating to QBasicTimer is probably a good idea anyway, but it'll require some pretty serious refactoring.

from quamash.

harvimt avatar harvimt commented on June 17, 2024

I've pushed https://github.com/harvimt/quamash/tree/gh62 which has pretty much the minimum code needed to fix this, but it seems kind of fugly. (like _SimpleTimer and cancellable should be changed, and maybe simple timer should be a factory function that takes in a QtCore like make_signaller does?)

from quamash.

pohmelie avatar pohmelie commented on June 17, 2024

I'm glad that you find the problem. Your patch works just fine in place of memory usage. That's great! There is some problem, when I make KeyboardInterrupt (ctrl-c) the test code above. I have infinite logging:

Traceback (most recent call last):
  File "/home/broomrider/tmp/quamash/quamash/__init__.py", line 191, in timerEvent
    self.callback()
  File "/home/broomrider/tmp/quamash/quamash/__init__.py", line 332, in upon_timeout
    assert timer in self.__timers, 'Timer {} not among {}'.format(timer, self.__timers)
AssertionError: Timer None not among []

But that is minor problem, hope for master tree update soon 👏

from quamash.

harvimt avatar harvimt commented on June 17, 2024

try now, I changed that from an assertion to a warning.

from quamash.

pohmelie avatar pohmelie commented on June 17, 2024

I think this can be closed since now 👍

from quamash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.