WebView: fix 2 cases of crash, no space on the link start

git-svn-id: svn://kolibrios.org@8350 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
2020-12-08 23:32:54 +00:00
parent b26a213fce
commit 294679216a
5 changed files with 17 additions and 17 deletions

View File

@@ -25,11 +25,8 @@ struct DrawBufer {
};
char draw_buf_not_enaught_ram[] =
"'DrawBufer needs more memory than currenly available.
Application could be unstable.
Requested size: %i Mb
Free RAM: %i Mb' -E";
"'DrawBufer requested %i MB more memory than the system has.
Application could be unstable.' -E";
bool DrawBufer::Init(dword i_bufx, i_bufy, i_bufw, i_bufh)
{
@@ -189,8 +186,8 @@ void DrawBufer::IncreaseBufSize()
}
free_ram_size = GetFreeRAM() * 1024;
if (alloc_size >= free_ram_size) {
sprintf(#error_str, #draw_buf_not_enaught_ram, alloc_size/1048576, free_ram_size/1048576);
if (alloc_size > free_ram_size) {
sprintf(#error_str, #draw_buf_not_enaught_ram, alloc_size - free_ram_size/1048576);
notify(#error_str);
}
}