haskell-gi-base 0.21.4 → 0.21.5
raw patch · 6 files changed
+52/−6 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.GI.Base.ManagedPtr: releaseObject :: (HasCallStack, GObject a) => a -> IO ()
Files
- ChangeLog.md +4/−0
- Data/GI/Base/Attributes.hs +8/−0
- Data/GI/Base/ManagedPtr.hs +12/−0
- LICENSE +14/−0
- c/hsgclosure.c +12/−4
- haskell-gi-base.cabal +2/−2
ChangeLog.md view
@@ -1,3 +1,7 @@+### 0.21.5+++ Add [releaseObject](https://hackage.haskell.org/package/haskell-gi-base-0.21.5/docs/Data-GI-Base-ManagedPtr.html#v:releaseObject), a function useful for manually releasing memory associated to GObjects.+ ### 0.21.4 + Add support for callback-valued properties.
Data/GI/Base/Attributes.hs view
@@ -13,6 +13,14 @@ -- attribute, but we can also have attributes for types not descending -- from `Data.GI.Base.BasicTypes.GObject`). --+-- If you're wondering what the possible attributes of a GObject are,+-- look at the list of properties in the documentation, e.g. the+-- Properties heading of the docs for 'GI.Gtk.Objects.Button' lists+-- properties such as @image@ and @relief@. Parent classes may also+-- introduce properties, so since a Button is an instance of+-- @IsActionable@, it inherits properties like @actionName@ from+-- 'GI.Gtk.Interfaces.Actionable' too.+-- -- As an example consider a @button@ widget and a property (of the -- Button class, or any of its parent classes or implemented -- interfaces) called "label". The simplest way of getting the value
Data/GI/Base/ManagedPtr.hs view
@@ -31,6 +31,7 @@ -- * Wrappers , newObject , wrapObject+ , releaseObject , unrefObject , disownObject , newBoxed@@ -274,6 +275,17 @@ when (ptr == nullPtr) (nullPtrWarning "wrapObject" callStack) fPtr <- newManagedPtr' ptr_to_g_object_unref $ castPtr ptr return $! constructor fPtr++-- | Unref the given `GObject` and disown it. Use this if you want to+-- manually release the memory associated to a given `GObject`+-- (assuming that no other reference to the underlying C object exists)+-- before the garbage collector does it. It is typically not safe to+-- access the `GObject` after calling this function.+releaseObject :: (HasCallStack, GObject a) => a -> IO ()+releaseObject obj = do+ ptr <- disownObject obj+ dbgDealloc obj+ dbg_g_object_unref ptr -- It is fine to use unsafe here, since all this does is schedule an -- idle callback. The scheduling itself will never block for a long
LICENSE view
@@ -1,3 +1,17 @@+The haskell-gi-base library and included works are provided under the terms of+the GNU Library General Public License (LGPL) version 2.1 with the following+exception:++Static linking of applications or any other source to the haskell-gi-base+library does not constitute a modified or derivative work and does not require+the author(s) to provide source code for said work, to link against the shared+haskell-gi-base libraries, or to link their applications against a+user-supplied version of haskell-gi-base. If you link applications to a+modified version of haskell-gi-base, then the changes to haskell-gi-base must+be provided under the terms of the LGPL.++----------------------------------------------------------------------------+ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999
c/hsgclosure.c view
@@ -26,13 +26,21 @@ A mutex protecting the log file handle. We make it recursive, i.e. refcounted, so it is OK to lock repeatedly in the same thread. */-static pthread_mutex_t log_mutex =+static pthread_mutex_t log_mutex #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;+ = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; #elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)- PTHREAD_RECURSIVE_MUTEX_INITIALIZER;+ = PTHREAD_RECURSIVE_MUTEX_INITIALIZER; #else- #error "Recursive mutex initializers not supported on this platform."+ ;+__attribute__ ((constructor)) static void init_log_mutex()+{+ pthread_mutexattr_t attr;+ pthread_mutexattr_init(&attr);+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);+ pthread_mutex_init(&log_mutex, &attr);+ pthread_mutexattr_destroy(&attr);+} #endif /* Give the current thread exclusive access to the log */
haskell-gi-base.cabal view
@@ -1,5 +1,5 @@ name: haskell-gi-base-version: 0.21.4+version: 0.21.5 synopsis: Foundation for libraries generated by haskell-gi description: Foundation for libraries generated by haskell-gi homepage: https://github.com/haskell-gi/haskell-gi-base@@ -9,7 +9,7 @@ author: Will Thompson, Iñaki García Etxebarria, Jonas Platte-maintainer: Iñaki García Etxebarria (garetxe@gmail.com)+maintainer: Iñaki García Etxebarria (inaki@blueleaf.cc) stability: Experimental category: Development build-type: Simple