View Issue Details

IDProjectCategoryView StatusLast Update
0030585LazarusWidgetsetpublic2016-09-18 14:33
ReporterC Western Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionduplicate 
PlatformMacOSX 
Product Version1.7 (SVN) 
Summary0030585: Intermittent hang on MacOSX Carbon associated with file dialogs
DescriptionSome IDE actions involving file dialogs - File, Open, or trying to save all messages can result in the IDE hanging from time to time. Debugging the active executable indicates that FindLCLWindow is stuck in a loop, because GetParent is returning the window itself. The attached patch fixes the widget set GetParent function so that it does not indicate that a window is a parent of itself, though this may be hiding a more fundamental error.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCarbon
Attached Files

Relationships

duplicate of 0029911 resolvedZeljan Rikalo Lazarus dev trunk often hangs when invoking File Select Dialog 

Activities

C Western

2016-09-08 23:31

reporter  

hang.patch (1,055 bytes)   
diff -uwNr --exclude=.svn --exclude=Makefile --exclude=Makefile.fpc --exclude=Makefile.compiled --exclude='*.rsj' --exclude='*.bak' --exclude='*.po' lazarus/lcl/interfaces/carbon/carbonwinapi.inc lazarus.w/lcl/interfaces/carbon/carbonwinapi.inc
--- lazarus/lcl/interfaces/carbon/carbonwinapi.inc	2016-04-30 11:12:40.000000000 +0100
+++ lazarus.w/lcl/interfaces/carbon/carbonwinapi.inc	2016-09-08 22:17:24.000000000 +0100
@@ -1811,8 +1811,11 @@
       DebugLn('TCarbonWidgetSet.GetParent Widget: ' + DbgS(TCarbonControl(Handle).Widget));
     {$ENDIF}
     Result := HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
-    if Result = 0 then // no parent control => then parent is a window?
+    if Result = 0 then begin // no parent control => then parent is a window?
       Result := HWnd(GetCarbonWidget(HIViewGetWindow(TCarbonControl(Handle).Widget)));
+      if Result = Handle then
+        Result := 0; // Sanity check - otherwise FindLCLWindow can be stuck in a loop
+    end;
   end;
   // Carbon windows has no parent
   
hang.patch (1,055 bytes)   

Bart Broersma

2016-09-18 14:33

developer   ~0094706

Please close this one.

Issue History

Date Modified Username Field Change
2016-09-08 23:31 C Western New Issue
2016-09-08 23:31 C Western File Added: hang.patch
2016-09-17 22:39 Bart Broersma Relationship added duplicate of 0029911
2016-09-18 14:33 Bart Broersma LazTarget => -
2016-09-18 14:33 Bart Broersma Note Added: 0094706
2016-09-18 14:33 Bart Broersma Status new => resolved
2016-09-18 14:33 Bart Broersma Resolution open => duplicate
2016-09-18 14:33 Bart Broersma Assigned To => Bart Broersma