mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
Fix warning c26409 (#14079)
We should avoid using `new` and `delete` in C/C++ code whenever possible as suggested by VC compiler.
This commit is contained in:
parent
de11527d76
commit
4ef64f3681
1 changed files with 2 additions and 2 deletions
|
|
@ -73,7 +73,7 @@ struct KernelTwo {
|
|||
|
||||
struct CustomOpOne : Ort::CustomOpBase<CustomOpOne, KernelOne> {
|
||||
void* CreateKernel(const OrtApi& /* api */, const OrtKernelInfo* /* info */) const {
|
||||
return new KernelOne();
|
||||
return std::make_unique<KernelOne>().release();
|
||||
};
|
||||
|
||||
const char* GetName() const { return "CustomOpOne"; };
|
||||
|
|
@ -92,7 +92,7 @@ struct CustomOpOne : Ort::CustomOpBase<CustomOpOne, KernelOne> {
|
|||
|
||||
struct CustomOpTwo : Ort::CustomOpBase<CustomOpTwo, KernelTwo> {
|
||||
void* CreateKernel(const OrtApi& /* api */, const OrtKernelInfo* /* info */) const {
|
||||
return new KernelTwo();
|
||||
return std::make_unique<CustomOpTwo>().release();
|
||||
};
|
||||
|
||||
const char* GetName() const { return "CustomOpTwo"; };
|
||||
|
|
|
|||
Loading…
Reference in a new issue