From 9112e7d5256300d6a60a5369f2316fc32e6ba39a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 30 Sep 2014 21:28:16 +0100 Subject: [PATCH] warn on profile save data loss --- libvips/iofuncs/gate.c | 10 +++++++++- python/test_overrides.py | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 python/test_overrides.py diff --git a/libvips/iofuncs/gate.c b/libvips/iofuncs/gate.c index dc317bcd..3fd85ca5 100644 --- a/libvips/iofuncs/gate.c +++ b/libvips/iofuncs/gate.c @@ -186,8 +186,16 @@ vips__thread_profile_init_cb( VipsThreadProfile *profile ) * * GPrivate has stopped working, be careful not to touch that. * - * Don't try to save: this is an emergency recovery path. + * Don't try to save: we must free all mem before saving and we + * probably haven't done that because vips_thread_shutdown() has not + * been called. */ + if( vips__thread_profile ) + vips_warn( "VipsGate", + "discarding unsaved state for thread %p --- " + "call vips_thread_shutdown() for this thread", + profile->thread ); + vips_thread_profile_free( profile ); } diff --git a/python/test_overrides.py b/python/test_overrides.py new file mode 100644 index 00000000..619744e6 --- /dev/null +++ b/python/test_overrides.py @@ -0,0 +1,14 @@ +#!/usr/bin/python + +import unittest +import math + +#import logging +#logging.basicConfig(level = logging.DEBUG) + +from gi.repository import Vips +from vips8 import vips + +class TestOverrides(unittest.TestCase): + +