ActivityBundle: don't wrap the temporal icon path in a TempFilePath - SL #4276
In the Journal, CellRendererActivityIcon is calling its do_render method after the temporal file is removed. This is because we wrap the icon path in a TempFilePath to control its deletion, but as we don't maintain any reference to it, its __del__ method deletes the temporal file. Note that returning the path directly has one disadventage: the temporal file is left in /tmp . As a comment in the get_icon method of ActivityBundle say, ideally we should return the icon data. But that implies a major change in the Journal model and views, and in the CellRendererIcon class. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
parent
0231969bba
commit
b6152b023a
@ -213,7 +213,7 @@ class ActivityBundle(Bundle):
|
||||
suffix='.svg')
|
||||
os.write(temp_file, icon_data)
|
||||
os.close(temp_file)
|
||||
return util.TempFilePath(temp_file_path)
|
||||
return temp_file_path
|
||||
|
||||
def get_activity_version(self):
|
||||
"""Get the activity version"""
|
||||
|
Loading…
Reference in New Issue
Block a user