Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/30/24 in all areas

  1. This is still a work in progress, but I'm really happy with how it is going so far so I thought I would share... https://github.com/jimmckeeth/FMXColorDialog There are a few custom components in the dialog, and there is a palette code library, plus there is a new CMYK color record. Just fun project to mess around with on vacation. FMXColorDialogSample_PseA8aEaZC.mp4
  2. Patrick PREMARTIN

    Cross platform color picker and palette library

    Awesome! Thank you so much for this work Jim. Clearly the best color selector I've seen in almost 30 years. I'll definitely be using it to replace the selectors supplied with Delphi when I refresh my icon generation and image button creation tools.
  3. Fudley

    TSkAnimatedImage assign?

    Checked the source. Its: [TSkAnimatedImage] .Source.assign([ other TSkAnimatedImage ].source); What a wonderful set of components the Skia set are. Very well done to the author!
  4. Dalija Prasnikar

    Thread leaks report (FastMM4)

    Raising exceptions in constructor never ever lead to memory leaks. Only if the code in destructor is bad and is not able to clean up partially initialized object instances. such situations may look like raising exception in constructor is at fault, while actually it is the destructor that needs to be fixed in such case.
  5. dummzeuch

    Thread leaks report (FastMM4)

    I see no problem with raising an exception in a constructor, provided you write the destructor in a way that can handle a partly constructed instance. Since you can't prevent any system or RTL exception to be raised from within the constructor, you'll have to handle that case anyway. Always keep in mind that an exception in a constructor will cause the destructor being called immediately. So don't do this: constructor TBla.Create; begin inherited; FSomeHelperObject := TSomeClass.Create; end; destructor TBla.Destroy; begin FSomeHelperObject.Free; // <== this might cause an AV if FSomeHelperObject hasn't been assigend inherited; end; But do this instead: destructor TBla.Destroy; begin if Assigned(FSomeHelperObject) then FSomeHelperObject.Free; inherited; end; (Or use FreeAndNil, which basically does the same internally.) You can easily test if your destructor can handle this case by temporarily putting a raise exception.Create('test') as the first statement in your constructor (before even calling inherited Create). I'm sure we are all guilty of writing wrong destructors at some time though.
×