go-qml / qml

QML support for the Go language
Other
1.96k stars 189 forks source link

Fix memory leak in GoImageProvider #74

Closed cookieo9 closed 9 years ago

cookieo9 commented 10 years ago

Qt uses "implicit shared memory" for many of its types which is a scheme similar to copy on write, and is tracked by reference counting in the constructors/destructor of its classes.

Unfortunately the image provider code creates an *QImage, which since it wasn't delete'd the destructor is not called, so when QML is done with its own copies, the shared image data can't be freed.

cookieo9 commented 10 years ago

Should I also do a patch for v0 (master)?

cookieo9 commented 9 years ago

Any reason this was closed? The memory leak still exists in v1.

niemeyer commented 9 years ago

That's awkward.. I don't think I had even seen this issue, despite the fact it marks me as having closed, and I would definitely not have closed it without a comment.

niemeyer commented 9 years ago

Ahh.. this is just a really bad UI. It must have closed it automatically because I deleted the v1-dev branch. I cannot reopen it either. Can you please repropose against v1?

cookieo9 commented 9 years ago

I have re-done the patch for v1, I should be able to make a pull request for it quickly.

cookieo9 commented 9 years ago

Done #88.