Skip to content

Commit 60c819b

Browse files
Fix Memory leak in drm_memory_manager of OsHandleLinux
Add virtual deconstructor to OsHandle and deconstructor to OsHandleLinux Add override keyword to destructor Add overriding deconstructor to OsHandleWin Add newline before private members #550 Signed-off-by: Cameron S Murtagh <cameron.murtagh00@gmail.com> Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
1 parent 5cc8120 commit 60c819b

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

shared/source/memory_manager/host_ptr_defines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -14,6 +14,8 @@
1414
namespace NEO {
1515

1616
struct OsHandle {
17+
virtual ~OsHandle() = default;
18+
1719
protected:
1820
OsHandle() = default;
1921
};

shared/source/os_interface/linux/drm_allocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ enum class CachePolicy : uint32_t;
1818
enum class CacheRegion : uint16_t;
1919

2020
struct OsHandleLinux : OsHandle {
21+
~OsHandleLinux() override = default;
2122
BufferObject *bo = nullptr;
2223
};
2324

shared/source/os_interface/windows/wddm_allocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
namespace NEO {
1616

1717
struct OsHandleWin : OsHandle {
18+
~OsHandleWin() override = default;
1819
D3DKMT_HANDLE handle = 0;
1920
D3DGPU_VIRTUAL_ADDRESS gpuPtr = 0;
2021
Gmm *gmm = nullptr;

0 commit comments

Comments
 (0)