<div dir="ltr"><span style="font-size:12.8px">> Of course, but that's some general point that you could make about everything.</span><span style="font-size:12.8px"><br></span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">That's not so general. The point is and should always be to produce a code that doesn't leave much to wonder about possible issues and to restrict the possible errors done by the user.</span></div><div><span style="font-size:12.8px">Sometimes that can be done by actually simplifying code, sometimes more checks have to be added, but the code should remain, as far as possible, clear.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Now not on all code we have to apply this (that's why i'm saying it's not that general), and i'm actually pointing a finger to specific code, as i did for the preset widgets.</span></div><div><span style="font-size:12.8px">So all in all my point is that "it worked till now, no bug don't fix it" imho is definitely not the right mindset given the speed of which Krita increases its dimension.<br></span></div><div><br></div><div><br></div><div><span style="font-size:12.8px">> Okay, that is a problem. But we need to be really careful when touching this code [...]</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Rereading myself i might have explained this "wrongly", meaning that, it is possible to "cleanly" delete the resources, but imho, doesn't make sense: the factories would have to be deleted as the first thing in the registry constructor and they would have to remove from the registry, through a call, all their cached colorspaces that aren't owned by the registry itself (checking the flag). </span></div><div><span style="font-size:12.8px">Only then the registry can loop through the remaining colorspaces, flag them to be deleted and actually delete them.</span></div><div><span style="font-size:12.8px">I don't know, this doesn't seem straightforward to me, and i don't see any reasons to do it. A better course would be having the registry own everything and the factories just build what they are supposed to, without holding anything, and then when having to release, the registry release everything.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">> [...] it's not a mess because we're too stupid to do it right: it's grown into a tangle because it contains years of bug fixes.</span><br></div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>I don't think you're stupid, i just think that when i see a tangle, i want to disentagle that as a first thing, before anything else, before stuff gets built on it that then needs to be changed as well, complicating a lot more the task.</div><div>Those issues together with other are all very dangerous time bombs.</div><div><br></div><div>That been said, i still didn't understand if it's correct that color profiles can be created and added to the colorspace registry <b>after</b> the startup or not (because this is happening now already).</div></div><br></div></div>