Page 1 of 1

OnUnloadExternalResourceAsync() wanted

Posted: Thu Apr 30, 2009 12:49 pm
by abb
How about to add subj? I'd like to get an information that my previous stream object is freed. It's obvious that it's easy to add such event somewhere near that location:

function TContentManager.CloseFakeHandleAndReleaseStream(Handle: THandle): BOOL;

...............

if Pair.m_Handle = Handle then
begin
>>>>>>>>>>>>>>>>>>>
Here we call OnUnloadExternalStreamAsync(Pair.m_Stream);
>>>>>>>>>>>>>>>>>>>
Pair.Free;
Result := True;
break;
end;

...............

It would be good to have Sender here too, but I didn't investigate your classes too deeply to suggest any solution for that.

Thanks.

Posted: Thu Apr 30, 2009 7:05 pm
by Softanics
Thank you for your question.

Look here:

Code: Select all

destructor TFakeHandleStreamPair.Destroy;
begin
   CloseHandle(m_Handle);
   m_Stream.Free;
end;


You can override TYourStream.Destroy to get this notification... Or I've missed something?

Thank you.

Posted: Fri May 01, 2009 5:42 am
by abb
Softanics wrote:Thank you for your question.

Look here:

Code: Select all

destructor TFakeHandleStreamPair.Destroy;
begin
   CloseHandle(m_Handle);
   m_Stream.Free;
end;


You can override TYourStream.Destroy to get this notification... Or I've missed something?

Thank you.

No, you didn't. I can agree that subclassing can resolve virtually everything. But I suggested to simplify developer's life. Why don't have "standard" event with "standard" Sender reference rather than to invent something at developer's side? It's easy, so why not to add it?

Thanks.

Posted: Sat May 02, 2009 2:47 pm
by Softanics
Please check latest version. We've added this event.

Thank you.

Posted: Sat May 02, 2009 9:14 pm
by abb
Softanics wrote:Please check latest version. We've added this event.

I'm sorry, but could you tell me, where to get the full version? AFAIR, I got a link from you, but I can't find it now. Or should I make an email request?

Posted: Sun May 03, 2009 7:39 am
by Softanics
I've sent you a letter, please check.

Thank you.