Fix memory leaks.
This commit is contained in:
parent
b41f925fed
commit
b1cb271351
@ -121,6 +121,7 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
|
|||||||
bitmap->Decompress = guac_rdp_bitmap_decompress;
|
bitmap->Decompress = guac_rdp_bitmap_decompress;
|
||||||
bitmap->SetSurface = guac_rdp_bitmap_setsurface;
|
bitmap->SetSurface = guac_rdp_bitmap_setsurface;
|
||||||
graphics_register_bitmap(context->graphics, bitmap);
|
graphics_register_bitmap(context->graphics, bitmap);
|
||||||
|
xfree(bitmap);
|
||||||
|
|
||||||
/* Set up glyph handling */
|
/* Set up glyph handling */
|
||||||
glyph = xnew(rdpGlyph);
|
glyph = xnew(rdpGlyph);
|
||||||
@ -131,6 +132,7 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
|
|||||||
glyph->BeginDraw = guac_rdp_glyph_begindraw;
|
glyph->BeginDraw = guac_rdp_glyph_begindraw;
|
||||||
glyph->EndDraw = guac_rdp_glyph_enddraw;
|
glyph->EndDraw = guac_rdp_glyph_enddraw;
|
||||||
graphics_register_glyph(context->graphics, glyph);
|
graphics_register_glyph(context->graphics, glyph);
|
||||||
|
xfree(glyph);
|
||||||
|
|
||||||
/* Set up pointer handling */
|
/* Set up pointer handling */
|
||||||
pointer = xnew(rdpPointer);
|
pointer = xnew(rdpPointer);
|
||||||
@ -139,6 +141,7 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
|
|||||||
pointer->Free = guac_rdp_pointer_free;
|
pointer->Free = guac_rdp_pointer_free;
|
||||||
pointer->Set = guac_rdp_pointer_set;
|
pointer->Set = guac_rdp_pointer_set;
|
||||||
graphics_register_pointer(context->graphics, pointer);
|
graphics_register_pointer(context->graphics, pointer);
|
||||||
|
xfree(pointer);
|
||||||
|
|
||||||
/* Set up GDI */
|
/* Set up GDI */
|
||||||
instance->update->Palette = guac_rdp_gdi_palette_update;
|
instance->update->Palette = guac_rdp_gdi_palette_update;
|
||||||
|
@ -45,6 +45,8 @@
|
|||||||
#include <freerdp/freerdp.h>
|
#include <freerdp/freerdp.h>
|
||||||
#include <freerdp/channels/channels.h>
|
#include <freerdp/channels/channels.h>
|
||||||
#include <freerdp/input.h>
|
#include <freerdp/input.h>
|
||||||
|
#include <freerdp/codec/color.h>
|
||||||
|
#include <freerdp/cache/cache.h>
|
||||||
|
|
||||||
#include <guacamole/socket.h>
|
#include <guacamole/socket.h>
|
||||||
#include <guacamole/protocol.h>
|
#include <guacamole/protocol.h>
|
||||||
@ -58,11 +60,25 @@ void __guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, in
|
|||||||
int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed);
|
int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed);
|
||||||
void __guac_rdp_send_altcode(guac_client* client, int altcode);
|
void __guac_rdp_send_altcode(guac_client* client, int altcode);
|
||||||
|
|
||||||
|
|
||||||
int rdp_guac_client_free_handler(guac_client* client) {
|
int rdp_guac_client_free_handler(guac_client* client) {
|
||||||
|
|
||||||
/* STUB */
|
rdp_guac_client_data* guac_client_data =
|
||||||
|
(rdp_guac_client_data*) client->data;
|
||||||
|
|
||||||
/* FIXME: Clean up RDP client + disconnect */
|
freerdp* rdp_inst = guac_client_data->rdp_inst;
|
||||||
|
rdpChannels* channels = rdp_inst->context->channels;
|
||||||
|
|
||||||
|
/* Clean up RDP client */
|
||||||
|
freerdp_channels_close(channels, rdp_inst);
|
||||||
|
freerdp_channels_free(channels);
|
||||||
|
freerdp_disconnect(rdp_inst);
|
||||||
|
freerdp_clrconv_free(((rdp_freerdp_context*) rdp_inst->context)->clrconv);
|
||||||
|
cache_free(rdp_inst->context->cache);
|
||||||
|
freerdp_free(rdp_inst);
|
||||||
|
|
||||||
|
/* Free client data */
|
||||||
|
free(guac_client_data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user