OSDN Git Service

ResPopBrowserの参照カウントを正しくなるように修正
authoreggcake <eggcake>
Mon, 11 Aug 2008 10:35:29 +0000 (10:35 +0000)
committereggcake <eggcake>
Mon, 11 Aug 2008 10:35:29 +0000 (10:35 +0000)
ResPopupBrowser.pas

index 8238d2e..d186b4c 100644 (file)
@@ -66,6 +66,8 @@ begin
     RawDocument := '';
     FEvent := nil;
     ShowWindow(Self.Handle, SW_HIDE);
+    GikoSys.ShowRefCount('ResPop Create', Self.ControlInterface);
+    GikoSys.ShowRefCount('ResPop.Document Create', Self.ControlInterface.Document);
 end;
 
 destructor TResPopupBrowser.Destroy;
@@ -84,6 +86,10 @@ begin
         FEvent := nil;
     end;
     FThread := nil;
+
+    GikoSys.ShowRefCount('ResPop Desctroy', Self.ControlInterface);
+    GikoSys.ShowRefCount('ResPop.Document Create', Self.ControlInterface.Document);
+
        inherited Destroy;
 end;
 
@@ -136,7 +142,7 @@ begin
 end;
 procedure TResPopupBrowser.NavigateBlank(Forced: Boolean);
 begin
-    if (not Assigned(Self.Document)) or (Forced) then begin
+    if (not Assigned(Self.ControlInterface.Document)) or (Forced) then begin
         Self.Navigate('about:blank');
     end;
     while (Self.ReadyState <> READYSTATE_COMPLETE) and
@@ -192,7 +198,7 @@ begin
         ARect := CalcRect(Screen.MonitorFromPoint(p).WorkareaRect,
                         not OnlyTitle);
 
-        FEvent := THTMLDocumentEventSink.Create(Self, Self.Document, HTMLDocumentEvents2);
+        FEvent := THTMLDocumentEventSink.Create(Self, Self.OleObject.Document, HTMLDocumentEvents2);
         FEvent.OnClick := ResPopupBrowserClick;
         FEvent.OnDoubleClick := ResPopupBrowserDbClick;
         Self.Visible := True;
@@ -272,7 +278,7 @@ var
     DIV_X, DIV_Y: Integer;
 begin
        GetCursorpos(p);
-    ele := ((Self.Document as IHTMLDocument2).body as IHTMLElement2);
+    ele := ((Self.ControlInterface.Document as IHTMLDocument2).body as IHTMLElement2);
     if Scroll then begin
         h := GetWindowHeight + 10;
         w := ele.scrollWidth + 25