| 1 | // Licensed to the .NET Foundation under one or more agreements. |
| 2 | // The .NET Foundation licenses this file to you under the MIT license. |
| 3 | // See the LICENSE file in the project root for more information. |
| 4 | |
| 5 | |
| 6 | |
| 7 | #ifndef __VMHOLDER_H_ |
| 8 | #define __VMHOLDER_H_ |
| 9 | |
| 10 | #include "holder.h" |
| 11 | |
| 12 | template <typename TYPE> |
| 13 | inline void DoTheReleaseHost(TYPE *value) |
| 14 | { |
| 15 | if (value) |
| 16 | { |
| 17 | BEGIN_SO_TOLERANT_CODE_CALLING_HOST(GetThread()); |
| 18 | value->Release(); |
| 19 | END_SO_TOLERANT_CODE_CALLING_HOST; |
| 20 | |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | NEW_WRAPPER_TEMPLATE1(HostComHolder, DoTheReleaseHost<_TYPE>); |
| 25 | |
| 26 | #endif |
| 27 | |