From 17ebdddfe709e63dc776ff952661177661785a5d Mon Sep 17 00:00:00 2001 From: "Ying-Chun Liu (PaulLiu)" Date: Fri, 3 Aug 2012 16:40:05 +0800 Subject: [PATCH] Refine the extension loading code. The extension loading code is fixed by commit 48ad5feb0a6ad831d863f89ed74b443021e54303 However, it looks weird that the extension is not initialized in rdp_new(). So we split the load/init steps out of new step. Thus to achieve the same result that 48ad5feb0a6ad831d863f89ed74b443021e54303 des. Signed-off-by: Ying-Chun Liu (PaulLiu) --- libfreerdp-core/extension.c | 9 ++++++--- libfreerdp-core/extension.h | 1 + libfreerdp-core/freerdp.c | 2 +- libfreerdp-core/rdp.c | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libfreerdp-core/extension.c b/libfreerdp-core/extension.c index 44fd628c5..bcc33b282 100644 --- a/libfreerdp-core/extension.c +++ b/libfreerdp-core/extension.c @@ -194,6 +194,12 @@ int extension_post_connect(rdpExtension* ext) return 0; } +void extension_load_and_init_plugins(rdpExtension* extension) +{ + extension_load_plugins(extension); + extension_init_plugins(extension); +} + rdpExtension* extension_new(freerdp* instance) { rdpExtension* extension = NULL; @@ -203,9 +209,6 @@ rdpExtension* extension_new(freerdp* instance) extension = xnew(rdpExtension); extension->instance = instance; - - extension_load_plugins(extension); - extension_init_plugins(extension); } return extension; diff --git a/libfreerdp-core/extension.h b/libfreerdp-core/extension.h index 25273023f..176888ea3 100644 --- a/libfreerdp-core/extension.h +++ b/libfreerdp-core/extension.h @@ -48,6 +48,7 @@ FREERDP_API int extension_post_connect(rdpExtension* extension); FREERDP_API rdpExtension* extension_new(freerdp* instance); FREERDP_API void extension_free(rdpExtension* extension); +FREERDP_API void extension_load_and_init_plugins(rdpExtension* extension); #endif /* __EXTENSION_H */ diff --git a/libfreerdp-core/freerdp.c b/libfreerdp-core/freerdp.c index 23fe98361..40184fb7e 100644 --- a/libfreerdp-core/freerdp.c +++ b/libfreerdp-core/freerdp.c @@ -54,7 +54,7 @@ boolean freerdp_connect(freerdp* instance) IFCALLRET(instance->PreConnect, status, instance); - rdp->extension = extension_new(instance); + extension_load_and_init_plugins(rdp->extension); extension_pre_connect(rdp->extension); if (status != true) diff --git a/libfreerdp-core/rdp.c b/libfreerdp-core/rdp.c index 6e48916a3..f3b71625d 100644 --- a/libfreerdp-core/rdp.c +++ b/libfreerdp-core/rdp.c @@ -915,7 +915,8 @@ rdpRdp* rdp_new(freerdp* instance) if (instance != NULL) instance->settings = rdp->settings; - + + rdp->extension = extension_new(instance); rdp->transport = transport_new(rdp->settings); rdp->license = license_new(rdp); rdp->input = input_new(rdp);