New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings never freed when retrieving text from virtual buffers #591

Closed
nvaccessAuto opened this Issue Mar 8, 2010 · 1 comment

Comments

Projects
None yet
2 participants
@nvaccessAuto

nvaccessAuto commented Mar 8, 2010

Reported by jteh on 2010-03-08 16:37
Str:

  1. Open http://www.nvda-project.org/ in Firefox and move focus inside the buffer.
  2. Press NVDA+ctrl+z to activate the Python console.
  3. Type:
    ti = focus.virtualBuffer.makeTextInfo("all") for i in xrange(20000): t = ti.text
    Actual: Massive memory leak (NVDA shoots up to about 300 mb here).
    Expected: Uh... no memory leak.
    Note that closing the browser doesn't clean this up.

This happens because VBuf_getTextInRange allocates a string on the server side which is then marshalled to the client but never freed. We figured that ctypes was freeing the string when it was garbage collected by Python (which is actually incorrect, since ctypes didn't allocate it), but it seems that ctypes (correctly) doesn't do this after all.

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Mar 9, 2010

Comment 1 by jteh on 2010-03-09 02:21
Fixed in 703bac8 with some cleanup in e226c48.
Changes:
State: closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment