[Weak] TUniDataSetSpecificOptions.FOwner

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

[Weak] TUniDataSetSpecificOptions.FOwner

Post by CristianP » Fri 07 Jun 2013 12:22

Hello,

TUniDataSetSpecificOptions.FOwner must be marked as [Weak] for ARC because it generates a reference cycle.

TUniQuery for example will have RefCount 2 immediately after creation and I need to call DisposeOf to free the object.

And I think the same is for TUniConnectionSpecificOptions.FOwner

Best Regards,
Cristian Peta

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: [Weak] TUniDataSetSpecificOptions.FOwner

Post by AlexP » Fri 07 Jun 2013 12:59

Hello,

Thank you for the information, we have added an attribute [week] to TUniDataSetSpecificOptions.FOwner and TUniConnectionSpecificOptions, as well as to TUniTransactionSpecificOptions.

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: [Weak] TUniDataSetSpecificOptions.FOwner

Post by CristianP » Mon 10 Jun 2013 09:03

Hello,

And a little suggestion.
In my opinion for the future there would be better to use

Code: Select all

{$IFDEF AUTOREFCOUNT}[weak]{$ENDIF}
instead of

Code: Select all

{$IFDEF NEXTGEN}[weak]{$ENDIF}
When ARC will be introduced to desktop compilers, NEXTGEN would not be there.

Best Regards,
Cristian Peta

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: [Weak] TUniDataSetSpecificOptions.FOwner

Post by AlexP » Mon 10 Jun 2013 09:57

Hello,

Thank you for the information, we know about these defines. There is no difference between their using for the time being. We will replace these defines in the new version.

Post Reply