Home » U++ Library support » TopWindow&PopUp, TrayIcon » Function holding a static TopWindow. Is it safe?
Function holding a static TopWindow. Is it safe? [message #45863] |
Fri, 15 January 2016 14:00 |
|
koldo
Messages: 3372 Registered: August 2008
|
Senior Veteran |
|
|
SetMessage() is a function that opens a TopWindow showing a message in a list.
Is it safe to have a static TopWindow inside a function?
Could it be that when the program ends, CtrlCore could not close it?
What would be a safer/better way to do it?
class MessageWindow : public TopWindow {
void SetMessage(const String message);
~MessageWindow() {TopWindow::Close();}
...
};
void SetMessage(const String message) {
static MessageWindow window;
window.SetMessage(message);
}
Best regards
IƱaki
|
|
|
Goto Forum:
Current Time: Mon Jun 10 11:52:51 CEST 2024
Total time taken to generate the page: 0.01176 seconds
|