Every time I access an instance of System.Data.SQLite.SQLiteFactory, I get this exception when in debug-mode. Can I safely ignore it? Or what can I do to prevent this error?

I'm not able to reproduce this issue.  Could you provide some more details about the kind of behavior you are seeing and what code triggers the issue?


I only have this problem with the DLL here on this site, I never encountered using the dll from Phx Software (using the same code).

I only see the error when I set the IDE to break on ALL thrown exceptions.

The code looks like this:

Private Class Sql

    Private Factory As New System.Data.SQLite.SQLiteFactory()

    Public Function Connect() As Boolean

        Dim Conn as DbConnection = Fact.CreateConnection()

    End Function

End Class

-----

It seems to be related to threads. The first thread has no problems creating a new instance of the class above, but the second thread will complain with:

A callback was made on a garbage collected delegate of type 'System.Data.SQLite!System.Data.SQLite.SQLiteLogCallback::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.


Possibly fixed by checked-in [3303a4f55b].  I still need to come up with a test case for this.  Meanwhile, would you please test this fix in your environment and let me know if the issue is still present?


I'm not familar with building the library myself, so I'd have to wait for


Okay, I made some progress. Turns out I was using version of the library. I just upgraded to 1.0.76, and I have not encountered the problem since then. So I guess this bug is already fixed in the commits between .74 and .76.