On Tue, May 12, 2009 at 5:32 AM, OpenDBX devel list <
libopendbx-devel@lists.sourceforge.net> wrote:

> On Tuesday 12 May 2009 00:09:37 OpenDBX devel list wrote:
> > Suppose this case (as I think I am having in sqlite in windows):
> >
> > 1) I call odbx_init
> > 2) odbx_init  inside, calls to:   _odbx_lib_open
> > 3) The foading of the backend library went perfect.
> > 4) Then, after that if, I do this:
> >
> >     if( ( odbxreg = (regfunc) GetProcAddress( (HMODULE) handle->backend,
> > "odbxdrv_register" ) ) == NULL )
> >     {
> >         return -ODBX_ERR_NOOP;
> >     }
> >
> > 5) suppose that function returns null, so  -ODBX_ERR_NOOP is returned.
> > 6) we come back where _odbx_lib_open was called in odbx_init and we see:
> >
> >
> > if( ( err = _odbx_lib_open( *handle, backend ) ) < 0 )
> >     {
> >         free( *handle );
> >         return err;
> >     }
> >
> > 7) I will free handle and return. But, FreeLibrary was never called.
> > Actually, _odbx_lib_close() was never called.
> >
> > So, my question is, shouldn't the if be something like this:
> >
> > if( ( err = _odbx_lib_open( *handle, backend ) ) < 0 )
> >     {
> >         _odbx_lib_close( *handle );
> >         free( *handle );
> >         return err;
> >     }
>
> You are right, the DLL should be closed it an error like this occurs. The
> right place for this would be in _odbx_lib_open() shortly before
> returning -ODBX_ERR_NOOP.


Yes, it seems like a better place!


>
>
> Thanks for the hint
>

You are welcome.

Mariano


>
>
> Norbert
> --
> OpenPGP public key
> http://www.linuxnetworks.de/norbert.pubkey.asc
>
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> libopendbx-devel mailing list
> libopendbx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libopendbx-devel
> http://www.linuxnetworks.de/doc/index.php/OpenDBX
>
>
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
libopendbx-devel mailing list
libopendbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopendbx-devel
http://www.linuxnetworks.de/doc/index.php/OpenDBX

Reply via email to