[hafqa] [hafqa] [Bug 2168] New: API needs destroy functions for user data

From: bugzilla-daemon at lists.maemo.org bugzilla-daemon at lists.maemo.org
Date: Fri Oct 26 01:53:53 EEST 2007
https://bugs.maemo.org/show_bug.cgi?id=2168

           Summary: API needs destroy functions for user data
           Product: System software
           Version: 4.0
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Low
         Component: libosso
        AssignedTo: kimmo.hamalainen at nokia.com
        ReportedBy: danielk at openismus.com
         QAContact: libosso-bugs at maemo.org
                CC: murrayc at murrayc.com


A lot of functions in libosso API take callback function pointers as arguments,
and allow passing a generic user data pointer along when the callback is
invoked.  This functionality is very important to be able to properly implement
language bindings, as they need the user data pointer to manage the connection
between the binding and the underlying library.

So while libosso supports user data, it doesn't support destroy functions that
are invoked when the user data is no longer needed.  Effectively, this makes it
impossible, and not only for language bindings, to properly use dynamically
allocated user data with the libosso library.  If more cleanup than just
freeing the memory is required, as in the case of language bindings, this lack
of destroy functions for user data becomes critical.  Unfortunately there is no
really functional work-around available without making assumptions about how
the API will be used by other code, which is not possible in the case of
language bindings.

Since the C++ bindings will be part of the developer platform with Maemo 4.0,
we feel that fixing this problem is important.  Thus we propose to change the
API so that all libosso functions that take a user data argument also accept a
function pointer to a user-supplied destroy function.  If an API change is
deemed inappropriate at this point, the alternative solution of providing
additional entry points would also be acceptable.

A patch is in the works and will follow.


-- 
Configure bugmail: https://bugs.maemo.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the hafqa mailing list