summaryrefslogtreecommitdiff
path: root/src/cmsxform.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-09-21 13:52:25 +0100
committerRobin Watts <robin.watts@artifex.com>2013-02-15 11:10:08 +0000
commitdf3194a9139edeaa1293ad360cd5c50b176c0652 (patch)
treedcf5717d99829bb532a1951353c79c39626a9905 /src/cmsxform.c
parentcdd090f0ed2469a1f5a4fbbd8bf8ae38380f90fc (diff)
downloadlcms2-df3194a9139edeaa1293ad360cd5c50b176c0652.tar.gz
Fix LCMS threading issue with plugin registration.
When registering a plugin, allocations can be done. This can result in calls back to the user supplied malloc functions, which assume that a cmsContext will be supplied. In the current code there is no way to pass a cmsContext into the plugin registration. We therefore add a new function cmsPluginTHR that does take such a context.
Diffstat (limited to 'src/cmsxform.c')
-rw-r--r--src/cmsxform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmsxform.c b/src/cmsxform.c
index 5649801..0b0dd00 100644
--- a/src/cmsxform.c
+++ b/src/cmsxform.c
@@ -367,7 +367,7 @@ typedef struct _cmsTransformCollection_st {
static _cmsTransformCollection* TransformCollection = NULL;
// Register new ways to transform
-cmsBool _cmsRegisterTransformPlugin(cmsPluginBase* Data)
+cmsBool _cmsRegisterTransformPlugin(cmsContext id, cmsPluginBase* Data)
{
cmsPluginTransform* Plugin = (cmsPluginTransform*) Data;
_cmsTransformCollection* fl;
@@ -383,7 +383,7 @@ cmsBool _cmsRegisterTransformPlugin(cmsPluginBase* Data)
if (Plugin ->Factory == NULL) return FALSE;
- fl = (_cmsTransformCollection*) _cmsPluginMalloc(sizeof(_cmsTransformCollection));
+ fl = (_cmsTransformCollection*) _cmsPluginMalloc(id, sizeof(_cmsTransformCollection));
if (fl == NULL) return FALSE;
// Copy the parameters