RRUZ / vcl-styles-utils

Extend and improve the Delphi VCL Styles
https://theroadtodelphi.wordpress.com/
329 stars 115 forks source link

VCL.Styles.Ext RemoveStyle issues #226

Open CTBuhl opened 6 years ago

CTBuhl commented 6 years ago

The method VCL.Styles.Ext.TStyleManagerHelper.RemoveStyle creates a memory leak since it doesn't free Self.RegisteredStyles created in line 531 and doesn't really remove the style from the FRegisteredStyles property in the base class TStyleManager. Instead of lines 531-536, it should use the code part in TStyleManagerHelper.RegisteredStyles to determine TStyleManager.FRegisteredStyles (e.g. using a new private function _GetRegisteredStyles), iterate its elements until it finds the key to remove, remove the value data, remove the key and break the loop. vcl styles ext tstylemanagerhelper removestyle