GUACAMOLE-935: Merge fix for differing rdpBitmap free behavior.
This commit is contained in:
commit
3bc00c429a
24
configure.ac
24
configure.ac
@ -578,6 +578,30 @@ then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Variation in memory internal allocation/free behavior
|
||||||
|
if test "x${have_freerdp2}" = "xyes"
|
||||||
|
then
|
||||||
|
|
||||||
|
# FreeRDP 2.0.0-rc0 and older automatically free rdpBitmap and its
|
||||||
|
# associated data member within Bitmap_Free(), relying on the
|
||||||
|
# implementation-specific free handler to free only implementation-specific
|
||||||
|
# data. This changed in commit 2cf10cc, and implementations must now
|
||||||
|
# manually free all data associated with the rdpBitmap, even data which
|
||||||
|
# was not allocated by the implementation.
|
||||||
|
AC_MSG_CHECKING([whether Bitmap_Free() frees the rdpBitmap and its image data])
|
||||||
|
AC_EGREP_CPP([\"2\\.0\\.0-dev\"], [
|
||||||
|
|
||||||
|
#include <freerdp/version.h>
|
||||||
|
FREERDP_VERSION_FULL
|
||||||
|
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT([yes])]
|
||||||
|
[AC_DEFINE([FREERDP_BITMAP_FREE_FREES_BITMAP],,
|
||||||
|
[Whether Bitmap_Free() frees the rdpBitmap and its image data])],
|
||||||
|
[AC_MSG_RESULT([no])])
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
# Glyph callback variants
|
# Glyph callback variants
|
||||||
if test "x${have_freerdp2}" = "xyes"
|
if test "x${have_freerdp2}" = "xyes"
|
||||||
then
|
then
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "common/display.h"
|
#include "common/display.h"
|
||||||
#include "common/surface.h"
|
#include "common/surface.h"
|
||||||
|
#include "config.h"
|
||||||
#include "rdp.h"
|
#include "rdp.h"
|
||||||
|
|
||||||
#include <cairo/cairo.h>
|
#include <cairo/cairo.h>
|
||||||
@ -127,12 +128,14 @@ void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap) {
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
guac_common_display_free_buffer(rdp_client->display, buffer);
|
guac_common_display_free_buffer(rdp_client->display, buffer);
|
||||||
|
|
||||||
/* NOTE: FreeRDP-allocated memory for the rdpBitmap will NOT be
|
#ifndef FREERDP_BITMAP_FREE_FREES_BITMAP
|
||||||
* automatically released after this free handler is invoked, thus we must
|
/* NOTE: Except in FreeRDP 2.0.0-rc0 and earlier, FreeRDP-allocated memory
|
||||||
* do so manually here */
|
* for the rdpBitmap will NOT be automatically released after this free
|
||||||
|
* handler is invoked, thus we must do so manually here */
|
||||||
|
|
||||||
_aligned_free(bitmap->data);
|
_aligned_free(bitmap->data);
|
||||||
free(bitmap);
|
free(bitmap);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user