From 6297f548a8e5188842f08ca40907691eb68a6d50 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 26 Nov 2018 09:11:05 +0000 Subject: [PATCH] GLDraw: Texture driver leaks plugged, ide: GDB does not stop at 'unknown' frames in backtrace git-svn-id: svn://ultimatepp.org/upp/trunk@12578 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/GLDraw/Texture.cpp | 1 + uppsrc/ide/Debuggers/Gdb.cpp | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/uppsrc/GLDraw/Texture.cpp b/uppsrc/GLDraw/Texture.cpp index e5a507c1b..00043b51c 100644 --- a/uppsrc/GLDraw/Texture.cpp +++ b/uppsrc/GLDraw/Texture.cpp @@ -8,6 +8,7 @@ namespace Upp { GLuint CreateGLTexture(const Image& img, dword flags) { + MemoryIgnoreLeaksBlock __; // Linux drivers seem to be calling new without delete Size sz = img.GetSize(); GLuint texture_id; glGenTextures(1, &texture_id); diff --git a/uppsrc/ide/Debuggers/Gdb.cpp b/uppsrc/ide/Debuggers/Gdb.cpp index dbebcb031..35c7aa383 100644 --- a/uppsrc/ide/Debuggers/Gdb.cpp +++ b/uppsrc/ide/Debuggers/Gdb.cpp @@ -46,21 +46,25 @@ String FormatFrame(const char *s) s++; while(*s == ' ') s++; - if(s[0] != 'i' && s[1] != 'n') - return Null; - s += 2; + if(s[0] == 'i' && s[1] == 'n') + s += 2; while(*s == ' ') s++; } - if(!IsAlpha(*s)) - return Null; + String result; const char *w = strchr(s, '\r'); + if(!w) + w = strchr(s, '\n'); if(w) - return String(s, w); - w = strchr(s, '\n'); - if(w) - return String(s, w); - return s; + result = String(s, w); + else + result = s; + if(!IsAlpha(*s)) { + int q = result.ReverseFind(' '); + if(q >= 0) + result = result.Mid(q + 1); + } + return result.GetCount() > 2 ? result : Null; } void Gdb::CopyStack()