Recent

Author Topic: TShape component compiled with Cocoa WidgetSet crashes in TCocoaContext.SaveDC  (Read 3338 times)

freq

  • New Member
  • *
  • Posts: 22
Hi,

reported serious Cocoa problem here: http://bugs.freepascal.org/view.php?id=31253
I investigated already a couple of hours but need help now:

Crash will happen on calling: ctx.saveGraphicsState; All components based on TCocoaCustomControl have this problem trying to draw its content in drawRect.  NSGraphicsContext.currentContext.saveGraphicsState; will also crash e.g. if one put this e.g. into TCocoaCustomControl.drawRect(dirtyRect: NSRect);

But other NScalls from NSGraphicsContext like NSGraphicsContext.currentContext.isDrawingToScreen working.

Are there any conditions for the NSGraphicsContext that has to be fullfilled before calling to saveGraphicsState is allowed?

By the way: debugged with self compiled and signed gdb 1.12 from downloaded source code. Description here worked for me: https://sourceware.org/gdb/wiki/BuildingOnDarwin:

./configure
make
make install
codesign -f -s "gdbcert" /usr/local/bin/gdb

Thanks for any hint or fix.

« Last Edit: February 05, 2017, 07:56:19 am by freq »

freq

  • New Member
  • *
  • Posts: 22
In additional I created a couple of other Cocoa bug reports regarding hang and memory leaks:

http://bugs.freepascal.org/view.php?id=31261

http://bugs.freepascal.org/view.php?id=31262

fyi: Fixed two cocoa issues in: Revision 53966 (memory leak) and 53942 (crash). Please review (e.g. sekelsenmat?)

freq

  • New Member
  • *
  • Posts: 22
Fixed in Revision 54092, please review. This fixes also other crashes in libraries that are used in hosts which are compiled with xcode >=8.0 (latest version of AppKit)

 

TinyPortal © 2005-2018