!14 [sync] PR-12: trace: fix memory leak on closing the trace
From: @openeuler-sync-bot Reviewed-by: @Charlie_li Signed-off-by: @Charlie_li
This commit is contained in:
commit
d4ac3ec851
@ -1,10 +1,11 @@
|
|||||||
Name: libva
|
Name: libva
|
||||||
Version: 2.5.0
|
Version: 2.5.0
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: Libva is an implementation for VA-API (Video Acceleration API)
|
Summary: Libva is an implementation for VA-API (Video Acceleration API)
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/intel/libva
|
URL: https://github.com/intel/libva
|
||||||
Source0: https://github.com/intel/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
|
Source0: https://github.com/intel/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: trace-fix-memory-leak-on-closing-the-trace.patch
|
||||||
|
|
||||||
BuildRequires: libtool libudev-devel libXext-devel libXfixes-devel libdrm-devel git
|
BuildRequires: libtool libudev-devel libXext-devel libXfixes-devel libdrm-devel git
|
||||||
BuildRequires: libpciaccess-devel mesa-libEGL-devel mesa-libGL-devel libglvnd-devel
|
BuildRequires: libpciaccess-devel mesa-libEGL-devel mesa-libGL-devel libglvnd-devel
|
||||||
@ -67,6 +68,9 @@ autoreconf -vif
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 28 2023 fandehui <fandehui@xfusion.com> - 2.5.0-3
|
||||||
|
- trace: fix memory leak on closing the trace
|
||||||
|
|
||||||
* Tue Oct 13 2020 hanhui <hanhui15@huawei.com> - 2.5.0-2
|
* Tue Oct 13 2020 hanhui <hanhui15@huawei.com> - 2.5.0-2
|
||||||
- change mesa-libEGL-devel to libglvnd-devel in buildrequires
|
- change mesa-libEGL-devel to libglvnd-devel in buildrequires
|
||||||
|
|
||||||
|
|||||||
52
trace-fix-memory-leak-on-closing-the-trace.patch
Normal file
52
trace-fix-memory-leak-on-closing-the-trace.patch
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
From 9542f7ba9e88b04b4c1a5d7d71ba686132b7313c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
|
||||||
|
Date: Tue, 13 Aug 2019 07:15:44 -0700
|
||||||
|
Subject: [PATCH] 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>
|
||||||
|
---
|
||||||
|
va/va_trace.c | 7 -------
|
||||||
|
1 file changed, 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--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user