Application freezes while using WTimer and opening WDialog
Added by Yannick Lohrmann almost 5 years ago
Hi All,
I am creating a WT web application where the simplification of the code looks like the following:
ExampleWidget::ExampleWidget(WContainerWidget *parent)
: WContainerWidget(parent)
{
_timer = new WTimer();
_timer->setInterval(100);
_timer->timeout().connect(this,&ExampleWidget::timeout);
_timer->start();
_dialog = new WDialog();
// in this dialog you can chose some options ( but not that important)
}
Sometimes when I open the dialog the application just freezes. But when I disable the timer it never freezes and the dialog can be used all the time.
When I opened the source code in the webbrowser and opened the dialog when timer is running it stops like shown in the image.
I can see that text = null, so it seems normal that it crashes.
Has anyone encountered this problem and is there a solution for this or is this a bug in Wt ?
Kind regards,
Yannick
Replies (1)
RE: Application freezes while using WTimer and opening WDialog - Added by Yannick Lohrmann almost 5 years ago
The image doesn't seem to load but what the image should show was the source code:
function toUnicodeSelection(selection, text) {
var i;
var start = selection.start;
var end = selection.end;
for (i = 0; i < text.length; ++i) {
if (i >= selection.start && i >= selection.end)
return {start: start, end: end};
if (isHighSurrogate(text.charCodeAt(i)) &&
(i + 1) < text.length &&
isLowSurrogate(text.charCodeAt(i + 1))) {
if (i < selection.start)
---start;
if (i < selection.end)
---end;
}
}
return {start: start, end: end};
};
Where there was the following error in the first loop : Unable to get property 'length' of undefined or null reference