mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
timer: don't leak perf FD if zero
This commit is contained in:
parent
ffa3edbf51
commit
c644aabec8
@ -105,9 +105,9 @@
|
|||||||
#if CONFIG_LINUX_PERF
|
#if CONFIG_LINUX_PERF
|
||||||
|
|
||||||
#define START_TIMER \
|
#define START_TIMER \
|
||||||
static int linux_perf_fd; \
|
static int linux_perf_fd = -1; \
|
||||||
uint64_t tperf; \
|
uint64_t tperf; \
|
||||||
if (!linux_perf_fd) { \
|
if (linux_perf_fd == -1) { \
|
||||||
struct perf_event_attr attr = { \
|
struct perf_event_attr attr = { \
|
||||||
.type = PERF_TYPE_HARDWARE, \
|
.type = PERF_TYPE_HARDWARE, \
|
||||||
.size = sizeof(struct perf_event_attr), \
|
.size = sizeof(struct perf_event_attr), \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user