xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #535: debux-xshmimage-leak.patch

File debux-xshmimage-leak.patch, 1.3 KB (added by Antoine Martin, 8 years ago)

patch I've used to verify that we are not leaking xshm image wrappers

  • xpra/server/window_source.py

     
    933933                self.wid, coding, 1000.0*(now-damage_time), 1000.0*(now-rgb_request_time))
    934934        self.statistics.encoding_pending[sequence] = (damage_time, w, h)
    935935        self.queue_damage(self.make_data_packet_cb, window, damage_time, process_damage_time, self.wid, image, coding, sequence, options)
     936        import weakref
     937        v = weakref.ref(image)
     938        del image
     939        def check():
     940            i = v()
     941            if i:
     942                log.info("Image NOT garbage collected: %s", i)
     943        self.timeout_add(1000*5, check)
    936944
    937945    def make_data_packet_cb(self, window, damage_time, process_damage_time, wid, image, coding, sequence, options):
    938946        """ This function is called from the damage data thread!
  • xpra/x11/bindings/ximage.pyx

     
    523523
    524524    cdef object free_callback
    525525    cdef Bool padded
     526    cdef object __weakref__
    526527
    527528    def __init__(self, *args):                      #@DuplicatedSignature
    528529        self.free_callback = None