* Fix bug ID #24099 (make sure self is not destroyed while disconnecting sink)

git-svn-id: trunk@36771 -
This commit is contained in:
michael 2017-07-23 10:22:46 +00:00
parent 4e494607d6
commit aa5b2ff6fb

View File

@ -169,9 +169,11 @@ procedure TAbstractEventSink.Disconnect;
begin
if Assigned(FDispatch) then begin
// Unhook the sink from the automation server
Self._addRef;
InterfaceDisconnect(FDispatch, FDispIntfIID, FConnection);
FDispatch := nil;
FConnection := 0;
self._Release;
end;
end;