spillerrec / imgviewer

Customizable image viewer with minimalistic interface
2 stars 1 forks source link

Use reference counting in fileManager #38

Closed spillerrec closed 8 years ago

spillerrec commented 9 years ago

Doing manual memory management in fileManager is error-prone. While it appears to be pretty solid now, using shared_ptr would simplify the code a lot.

spillerrec commented 8 years ago

This was much more smoother than I had expected. However some of it might be because there potentially is incorrect code lurking around in fileManager. Expressions of the type image_ptr = old_image_ptr is often done to move the image, however this silently gets converted to a copy instead of a move. The code needs a more thorough review.

spillerrec commented 8 years ago

Images are no longer being unloaded, and memory usage continues to rise until all files are loaded. This needs to be fixed before version 1.0