Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions llvm/include/llvm/Support/SYCLPropertySetIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ class SYCLPropertyValue {
return static_cast<Type>(T);
}

~SYCLPropertyValue() {}

~SYCLPropertyValue() {
if (std::holds_alternative<std::byte *>(Val)) {
auto ByteArrayVal = std::get<std::byte *>(Val);
if (ByteArrayVal)
delete[] ByteArrayVal;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just use unique_ptr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @arsenm

I will give it another shot. I had a bit of an issue in getting unique_ptr to work with remainder of the code. I must be missing something. I will put up a change soon. Thanks again for looking into this.

Sincerely

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @arsenm

I added use of unique_ptr in 0d5af17
It was a good learning curve for me.

Thanks
Sincerely

}
}
SYCLPropertyValue() = default;

SYCLPropertyValue(Type Ty) {
Expand Down