ccp4 / DUI

CCP4 DIALS User Interface
GNU General Public License v2.0
5 stars 3 forks source link

Fix graphical glitches and segmentation fault in image viewer. #167

Closed dagewa closed 3 years ago

dagewa commented 3 years ago

It seems to me that img_w_cpp and build_qimg are essentially pseudoclasses. Graphical errors and occasional segfaults were occurring, probably when the data buffer arr_i.data went out of scope and was garbage-collected.

It might be possible to remove these classes and adopt a more functional approach that could tidy this up. But for now, simply keeping the data array around seems to fix the issue.

luisodls commented 3 years ago

It worth commenting that some data should remain in memory to make it fast and responsive, I am not sure about what part of the code it worth to make it more functional and less class-type. If it is part of the C++ code that generate bitmaps, I should warn that there is a class that keeps in memory an array with a palette transformation that should be generated only once, instead of every time a new bitmap is needed