Fix 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.
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;