You've already forked lazarus-ccr
* Fixed sigint by closing/re-opening resource
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2855 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -124,7 +124,9 @@ const
|
|||||||
|
|
||||||
type
|
type
|
||||||
IMyWidgetDesigner = interface(IUnknown)
|
IMyWidgetDesigner = interface(IUnknown)
|
||||||
|
['{AB6C118F-9520-626A-ED24-378E04D03474}']
|
||||||
procedure InvalidateRect(Sender: TObject; ARect: TRect; Erase: boolean);
|
procedure InvalidateRect(Sender: TObject; ARect: TRect; Erase: boolean);
|
||||||
|
procedure ClearMyForm;
|
||||||
function CreateComponent(ParentComp: TComponent;
|
function CreateComponent(ParentComp: TComponent;
|
||||||
TypeClass: TComponentClass;
|
TypeClass: TComponentClass;
|
||||||
const AUnitName: shortstring;
|
const AUnitName: shortstring;
|
||||||
@ -1942,6 +1944,8 @@ end;
|
|||||||
destructor NSObject.Destroy;
|
destructor NSObject.Destroy;
|
||||||
begin
|
begin
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
|
if assigned(Designer) then
|
||||||
|
Designer.ClearMyForm;
|
||||||
FNIBDocument.Free;
|
FNIBDocument.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -56,6 +56,12 @@ type
|
|||||||
TNSObjectDesignerMediator = class(TDesignerMediator,IMyWidgetDesigner)
|
TNSObjectDesignerMediator = class(TDesignerMediator,IMyWidgetDesigner)
|
||||||
private
|
private
|
||||||
FMyForm: NSObject;
|
FMyForm: NSObject;
|
||||||
|
protected
|
||||||
|
// This method is available through IMyWidgetDesigner and is used to
|
||||||
|
// clear the MyForm variable when the form is destroyed. This is necessary
|
||||||
|
// because it could be that this mediator is destroyed somewhat later,
|
||||||
|
// which could lead into problems.
|
||||||
|
procedure ClearMyForm;
|
||||||
public
|
public
|
||||||
function UseRTTIForMethods(aComponent: TComponent): boolean; override;
|
function UseRTTIForMethods(aComponent: TComponent): boolean; override;
|
||||||
// needed by the lazarus form editor
|
// needed by the lazarus form editor
|
||||||
@ -366,9 +372,12 @@ var
|
|||||||
Mediator: TNSObjectDesignerMediator;
|
Mediator: TNSObjectDesignerMediator;
|
||||||
begin
|
begin
|
||||||
Result:=inherited CreateMediator(TheOwner,aForm);
|
Result:=inherited CreateMediator(TheOwner,aForm);
|
||||||
Mediator:=TNSObjectDesignerMediator(Result);
|
Mediator:=Result as TNSObjectDesignerMediator;
|
||||||
|
if assigned(result) and assigned(aForm) and (aForm is NSObject) then
|
||||||
|
begin
|
||||||
Mediator.FMyForm:=aForm as NSObject;
|
Mediator.FMyForm:=aForm as NSObject;
|
||||||
Mediator.FMyForm.Designer:=Mediator;
|
Mediator.FMyForm.Designer:=Mediator as IMyWidgetDesigner;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TNSObjectDesignerMediator.FormClass: TComponentClass;
|
class function TNSObjectDesignerMediator.FormClass: TComponentClass;
|
||||||
@ -393,6 +402,11 @@ begin
|
|||||||
LCLIntf.InvalidateRect(LCLForm.Handle,@ARect,Erase);
|
LCLIntf.InvalidateRect(LCLForm.Handle,@ARect,Erase);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TNSObjectDesignerMediator.ClearMyForm;
|
||||||
|
begin
|
||||||
|
FMyForm := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TNSObjectDesignerMediator.SetBounds(AComponent: TComponent; NewBounds: TRect);
|
procedure TNSObjectDesignerMediator.SetBounds(AComponent: TComponent; NewBounds: TRect);
|
||||||
begin
|
begin
|
||||||
if AComponent is tiOSFakeComponent then begin
|
if AComponent is tiOSFakeComponent then begin
|
||||||
|
Reference in New Issue
Block a user