I fixed small memory leak / assert if a trace file can't be loaded due to being 
recorded with a newer version number than qapitrace. In this scenario, there is 
no error message that gets shown in the UI, but the title bar is updated with 
the trace file name, so the situation is very confusing. Is there an easy way 
to address these issues? I haven't used Qt enough yet to fully understand the 
moc files, etc, so I don't know the easiest way to add an 'error' Qevent that 
can be emitted back to the main window from the parser. Any help (or another 
patch) would be appreciated!

The version issue came up as I just started looking at the more-thumbnails 
branch, but it only supports version 4 of the trace files, and master is up to 
version 5 now. It seems the various branches need to be updated again.

- Peter

---
common/trace_parser.cpp | 2 ++
1 file changed, 2 insertions(+)

diff --git a/common/trace_parser.cpp b/common/trace_parser.cpp
index 095af67..6013b39 100644
--- a/common/trace_parser.cpp
+++ b/common/trace_parser.cpp
@@ -65,6 +65,8 @@ bool Parser::open(const char *filename) {
     version = read_uint();
     if (version > TRACE_VERSION) {
         std::cerr << "error: unsupported trace format version " << version << 
"\n";
+        delete file;
+        file = NULL;
         return false;
     }
     api = API_UNKNOWN;
--
1.8.1.msysgit.1

_______________________________________________
apitrace mailing list
apitrace@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/apitrace

Reply via email to