Blog Options
Archive
<< April 2024 >>-
Monday 22
- Easy Guide to Building a Pexels Gallery App with TMS WEB Core -
Wednesday 17
- New free component for sophisticated file uploads with TMS WEB Core -
Tuesday 16
- Closing the gap with TMS FNC UI Pack new additions -
Thursday 11
- Unveiling the Latest Enhancements in TMS VCL UI Pack -
Friday 5
- TMS components and Delphi and C++Builder 12.1 -
Wednesday 3
- Customizing the login page of your application using TMS Sphinx
- A Python library for using StellarDS.io effortlessly
- Introducing: How it Works with Holger - Building a Pexels gallery app with TMS WEB Core video series
- TMS FNC Cloud Pack with StellarDS.io backend: unparalleled productivity in VCL & FMX
Authors
- Bernard Roussely (1)
- Wagner Landgraf (82)
- Roman Yankovsky (2)
- Bart Holvoet (27)
- Aaron Decramer (18)
- Pieter Scheldeman (99)
- Nancy Lescouhier (32)
- Adrian Gallero (33)
- Bruno Fierens (403)
- Marcos Douglas B. Santos (5)
- Wagner R. Landgraf (1)
- Bradley Velghe (16)
- Bernard (2)
- Andrew Simard (86)
- Holger Flick (15)
- Gjalt Vanhouwaert (30)
- Tunde Keller (22)
- Masiha Zemarai (119)
Blog
All Blog Posts | Next Post | Previous PostTMS FixInsight 2019.11
Bookmarks:Thursday, November 28, 2019
I'm happy to announce FixInsight 2019.11 releaseWhat's New
* New : Rule W531 Actual parameter of FreeAndNil() must be a reference to class instance
* New : Rule W534 Class instance passed but interface expected
* Fixed : FixInsight hangs in some cases when running W525
* Fixed : File specified in {$INCLUDE} directive cannot be found in some cases
* Fixed : Access Violation on IDE start
* Fixed : "Load Defaults" button in Settings dialog doesn't restore general settings
* Fixed : Several parser issues
I'll add few more words about new features.
Rule W531 ensures that the parameter of FreeAndNil() is be a reference to a class instance. Due to FreeAndNil() implementation details, compiler is not able to check its parameter type.
This compiles, but this is wrong:
var Intf: IInterface; begin FreeAndNil(Intf); end;
Rule W534 ensures that a class instance is not passed when an interface is expected. This may compile, but due to reference counting a class can be released right after such method call.
Example:
type ISomeInterface = interface ['{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}'] end; TSomeClass = class(TInterfacedObject, ISomeInterface) end; procedure DoSomethingWithSomeInterface(const SomeInterface: ISomeInterface); begin // ... end; procedure DoSomethingWithSomeClass; var SomeClass: TSomeClass; begin SomeClass := TSomeClass.Create; try DoSomethingWithSomeInterface(SomeClass); // <= W534 // After this call SomeClass will be released due to reference counting finally SomeClass.Free; // cannot be released twice end; end;
FixInsightCL --project=c:\source\example.dpr --libpath="C:\Program Files (x86)\Embarcadero\Studio\20.0\source" --unitscopes=Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap--libpath should point to your Delphi source folder. And I suggest to copy values for --unitscopes and --unitaliases parameters from your project options.
Roman Yankovsky
Bookmarks:
This blog post has received 2 comments.
2. Friday, November 29, 2019 at 8:39:39 AM
Yes! This is actually planned for the next release (around February 2020).
Roman Yankovsky
All Blog Posts | Next Post | Previous Post
https://pascal.today/2016/12/16/take-care-of-const-and-interface-parameters/
Koistinen Mika