File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,12 @@ namespace dxvk {
99
99
const uint32_t extCount = extInfo.extensionNameList .count ();
100
100
pCreateInfo->ppEnabledExtensionNames = extCount > 0 ? new const char *[extCount] : nullptr ;
101
101
for (uint32_t i = 0 ; i < extCount; i++) {
102
- pCreateInfo->ppEnabledExtensionNames [i] = extInfo.extensionNameList .name (i);
102
+ const char * nameStr = extInfo.extensionNameList .name (i);
103
+ size_t nameLen = std::strlen (nameStr);
104
+ char * name = new char [nameLen + 1 ];
105
+ std::strncpy (name, nameStr, nameLen);
106
+ name[nameLen] = ' \0 ' ;
107
+ pCreateInfo->ppEnabledExtensionNames [i] = name;
103
108
}
104
109
pCreateInfo->info .ppEnabledExtensionNames = pCreateInfo->ppEnabledExtensionNames ;
105
110
pCreateInfo->info .enabledExtensionCount = extCount;
@@ -112,8 +117,15 @@ namespace dxvk {
112
117
D3D9VkDeviceCreateInfo* pCreateInfo) {
113
118
if (!pCreateInfo)
114
119
return ;
115
- if (pCreateInfo->ppEnabledExtensionNames != nullptr )
120
+
121
+ if (pCreateInfo->ppEnabledExtensionNames != nullptr ) {
122
+ for (uint32_t i = 0 ; i < pCreateInfo->info .enabledExtensionCount ; i++) {
123
+ delete pCreateInfo->ppEnabledExtensionNames [i];
124
+ }
125
+
116
126
delete[] pCreateInfo->ppEnabledExtensionNames ;
127
+ }
128
+
117
129
if (pCreateInfo->pQueueCreateInfos != nullptr )
118
130
delete[] pCreateInfo->pQueueCreateInfos ;
119
131
delete pCreateInfo;
You can’t perform that action at this time.
0 commit comments