Skip to content

Commit fe13594

Browse files
authored
Merge pull request #41 from eisenhauer/add-atl-free
2 parents c27af33 + c7fc510 commit fe13594

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
33
# The directory label is used for CDash to treat ATL as a subproject of GTKorvo
44
set(CMAKE_DIRECTORY_LABELS ATL)
55

6-
project(ATL VERSION 2.2.3 LANGUAGES C)
6+
project(ATL VERSION 2.3.0 LANGUAGES C)
77

88
# Some boilerplate to setup nice output directories
99
include(GNUInstallDirs)

atl.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ atl_base64_decode(unsigned char *input, unsigned char *output);
215215
extern char *
216216
atl_base64_encode(char *buffer, unsigned int len);
217217

218+
/*!
219+
* Free memory allocated by ATL functions.
220+
*
221+
* On Windows, memory allocated within a DLL must be freed by that same DLL
222+
* due to separate CRT heaps. Use this function to free strings returned by
223+
* attr_list_to_string(), atl_base64_encode(), and similar functions.
224+
*
225+
* \param ptr Pointer to memory allocated by ATL (may be NULL)
226+
*/
227+
extern void
228+
atl_free(void *ptr);
229+
218230
#if defined(__cplusplus) || defined(c_plusplus)
219231
}
220232
#endif

attr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,3 +2003,9 @@ atl_base64_encode(char *buffer, unsigned int len)
20032003
{
20042004
return base64_encode(buffer, len);
20052005
}
2006+
2007+
void
2008+
atl_free(void *ptr)
2009+
{
2010+
free(ptr);
2011+
}

0 commit comments

Comments
 (0)