|
|
Home » Developing U++ » Mac OS » Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
|
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa? [message #30681 is a reply to message #30680] |
Mon, 17 January 2011 00:53   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
thanks for quick response!
mirek wrote on Sun, 16 January 2011 22:33 |
What is 'HIObject' ? C++ class?
|
C++ (more likely) or just C (OO?) ? But.. from wikipedia:
Quote: | HIObject — a completely new object-oriented API which brings to Carbon an OO model for building GUIs. This is available in Mac OS X v10.2 or later, and gives Carbon programmers some of the tools that Cocoa developers have long been familiar with. Starting with Mac OS X v10.2, HIObject is the base class for all GUI elements in Carbon. HIView is supported by Interface Builder, part of Apple's developer tools. Traditionally GUI architectures of this sort have been left to third-party application frameworks to provide. Starting with Mac OS X v10.4, HIObjects are NSObjects and inherit the ability to be serialized into data streams for transport or saving to disk.
HITheme — uses QuickDraw and Quartz to render graphical user interface (GUI) elements to the screen. HITheme was introduced in Mac OS X v10.3, and Appearance Manager is a compatibility layer on top of HITheme since that version.
HIView Manager — manages creation, drawing, hit-testing, and manipulation of controls. Since Mac OS X v10.2, all controls are HIViews. In Mac OS X v10.4, the Control Manager was renamed HIView Manager.
Window Manager — manages creation, positioning, updating, and manipulation of windows. Since Mac OS X v10.2, windows have a root HIView.
Menu Manager — manages creation, selection, and manipulation of menus. Since Mac OS X v10.2, menus are HIObjects. Since Mac OS X v10.3, menu content may be drawn using HIViews, and all standard menus use HIViews to draw.
|
My strong suspicion is that HiObject and HIToolbox etc is a bridge for Cocoa to communicate with old but still in use Carbon (edit: or whatever is below Cocoa) functions.
[Updated on: Mon, 17 January 2011 01:05] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa? [message #32914 is a reply to message #30702] |
Mon, 20 June 2011 00:50   |
 |
daveremba
Messages: 32 Registered: June 2011 Location: Los Angeles, CA, USA
|
Member |
|
|
I encountered a similar problem.
Not a crash, but a leak detected in UPP/heapdbg.cpp
I get "Heap leaks detected!" on exit.
Here is what I found:
a stack trace showed a MacOSX carbon function
from Xft... calling
UPP Core/operator new()!
maybe the order of constructors in UPP
is calling Xft before it is initialized?
Here is a temp fix: in Draw/Font.cpp:
(telling UPP heap debugger to ignore this leak)
const CommonFontInfo& Font::Fi() const
{
// add:
MemoryIgnoreLeaksBlock __;
if(lastStdFont != AStdFont.AsInt64()) {
lastFiFont = INT_MIN;
lastStdFont = AStdFont.AsInt64();
}
if(AsInt64() == lastFiFont)
return lastFontInfo;
// known leak on MacOSX here: getAllCarbonLazyValues2000 calls Core.h op new()
// should not call UPP op new()
// from GetFontInfo() ... XftFontOpenPattern() ... getAllCarbonLazyValues2000() -> new()
lastFontInfo = GetFontInfo(*this);
lastFiFont = AsInt64();
return lastFontInfo;
}
A stack trace from gdb is attached to this message.
(stack frames 0-5 are from a temp gets() to force a halt
while gdb is attached to the process)
I haven't tried debugging UPP in UPP yet!
I think the better fix is to include some Xft header
in Font.cpp after Core.h ?
Core/Core.h:201:inline void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
Dave
[Updated on: Mon, 20 June 2011 01:00] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:24:52 CEST 2025
Total time taken to generate the page: 0.01173 seconds
|
|
|