Home » U++ Library support » TopWindow&PopUp, TrayIcon » Crash on ToolTip painting
Crash on ToolTip painting [message #28713] |
Mon, 13 September 2010 18:00  |
|
I've come to a problem where painting tooltip crashes the application with invalid memory access message. It only happens after I open and close a dialog within my app.
Simple testcase:#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define IMAGECLASS Imgs
#define IMAGEFILE <CtrlLib/Ctrl.iml>
#include <Draw/iml.h>
struct Dlg : TopWindow{
Button b;
typedef Dlg CLASSNAME;
Dlg() {
Title("Dialog").Sizeable();
SetRect(0,0,300,200);
Add(b.TopPos(10,20).LeftPos(10,100));
b.SetLabel("OK");
b<<=THISBACK(DoStuffAndExit);
}
void DoStuffAndExit(){
Hide();
Progress p;
p.SetText("Pretending work...");
for(int i=0;i<100;i++){
Sleep(25);
p.Step();
}
Close();
}
};
struct App : TopWindow {
ToolBar tool;
typedef App CLASSNAME;
App() {
Title("My application with bars").Sizeable();
AddFrame(tool);
tool.Set(THISBACK(TBar));
}
void MenuFn() {
Dlg().Execute();
}
void TBar(Bar& bar) {
bar.Add("Function", Imgs::open(), THISBACK(MenuFn));
}
};
GUI_APP_MAIN {
App().Run();
}
Steps to trigger the crash:
1) Click the icon on the toolbar.
2) Click "OK" button on the dialog.
3) Put the mouse above the icon on toolbar for a while to get the tooltip.
The app crashes even before the tooltip is displayed.
Environment: Linux, GCC 4.5.1, flags GUI MT
Now the question is what am I doing wrong? Any hints are more then welcome...
Best regards,
Honza
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 13:59:51 CEST 2025
Total time taken to generate the page: 0.03446 seconds
|