summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>2019-08-13 07:15:44 -0700
committerXinfengZhang <carl.zhang@intel.com>2019-08-19 09:08:53 +0800
commit9542f7ba9e88b04b4c1a5d7d71ba686132b7313c (patch)
tree9d9553f8d0541313add914547152106f7a61e90f
parentf094de317b4f498b57d47d8b0823a2a24cb125e1 (diff)
downloadlibva-9542f7ba9e88b04b4c1a5d7d71ba686132b7313c.tar.gz
trace: fix memory leak on closing the trace
Fixes: #327 This removes redundunt check for the number of log files. The whole 'struct va_trace' is being calloc-d and we can just check that pointers to log files are valid instead of relying on number of active log files. Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
-rwxr-xr-xva/va_trace.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/va/va_trace.c b/va/va_trace.c
index ccbd471..b1964c9 100755
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -99,8 +99,6 @@ struct trace_log_file {
};
struct trace_log_files_manager {
- int num;
-
struct trace_log_file log_file[MAX_TRACE_THREAD_NUM];
};
@@ -848,9 +846,6 @@ void va_TraceEnd(VADisplay dpy)
for(i = 0;i < MAX_TRACE_THREAD_NUM;i++) {
struct trace_log_file *plog_file = NULL;
- if(pva_trace->log_files_manager.num <= 0)
- break;
-
plog_file = &pva_trace->log_files_manager.log_file[i];
if(plog_file) {
if(plog_file->fn_log)
@@ -858,8 +853,6 @@ void va_TraceEnd(VADisplay dpy)
if(plog_file->fp_log)
fclose(plog_file->fp_log);
-
- pva_trace->log_files_manager.num--;
}
}