System.Data.SQLite

Check-in [3303a4f55b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the SQLiteLog.DomainUnload method, make sure to undo all things done in the SQLiteLog.Initialize method. Possible fix for ticket [98c70ac5a7].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3303a4f55b1de68ece45a53aa27fe2203134e725
User & Date: mistachkin 2011-10-18 03:07:04.208
References
2011-10-20
07:23 Closed ticket [98c70ac5a7]: SQLiteFactory raises CallbackOnCollectedDelegate plus 2 other changes artifact: 02878a4f6c user: mistachkin
2011-10-18
03:08 Pending ticket [98c70ac5a7]. artifact: 21d58b59eb user: mistachkin
Context
2011-10-18
03:23
Add an example MDA configuration file for Eagle suitable for use with the test suite. check-in: 7bade0d7b1 user: mistachkin tags: trunk
03:07
In the SQLiteLog.DomainUnload method, make sure to undo all things done in the SQLiteLog.Initialize method. Possible fix for ticket [98c70ac5a7]. check-in: 3303a4f55b user: mistachkin tags: trunk
2011-10-15
12:38
Improve test thread cleanup in test for ticket [84718e79fa]. check-in: 9e77b34813 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteLog.cs.
188
189
190
191
192
193
194











195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213












214
215
216
217
218
219
220
        private static void DomainUnload(
            object sender,
            EventArgs e
            )
        {
            lock (syncRoot)
            {











                //
                // BUGBUG: This will cause serious problems if other AppDomains
                //         have any open SQLite connections; however, there is
                //         currently no way around this limitation.
                //
                if (_sql != null)
                {
                    int rc = _sql.Shutdown();

                    if (rc != 0)
                        throw new SQLiteException(rc,
                            "Failed to shutdown interface.");

                    rc = _sql.SetLogCallback(null);

                    if (rc != 0)
                        throw new SQLiteException(rc,
                            "Failed to shutdown logging.");
                }













                //
                // NOTE: Remove the event handler for the DomainUnload event
                //       that we added earlier.
                //
                if (_domainUnload != null)
                {







>
>
>
>
>
>
>
>
>
>
>



















>
>
>
>
>
>
>
>
>
>
>
>







188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
        private static void DomainUnload(
            object sender,
            EventArgs e
            )
        {
            lock (syncRoot)
            {
                //
                // NOTE: Remove the default log event handler.
                //
                RemoveDefaultHandler();

                //
                // NOTE: Disable logging.  If necessary, it can be re-enabled
                //       later by the Initialize method.
                //
                _enabled = false;

                //
                // BUGBUG: This will cause serious problems if other AppDomains
                //         have any open SQLite connections; however, there is
                //         currently no way around this limitation.
                //
                if (_sql != null)
                {
                    int rc = _sql.Shutdown();

                    if (rc != 0)
                        throw new SQLiteException(rc,
                            "Failed to shutdown interface.");

                    rc = _sql.SetLogCallback(null);

                    if (rc != 0)
                        throw new SQLiteException(rc,
                            "Failed to shutdown logging.");
                }

                //
                // BUGFIX: Make sure to reset the callback for next time.  This
                //         must be done after it has been succesfully removed
                //         as logging callback by the SQLite core library as we
                //         cannot allow native code to refer to a delegate that
                //         has been garbage collected.
                //
                if (_callback != null)
                {
                    _callback = null;
                }

                //
                // NOTE: Remove the event handler for the DomainUnload event
                //       that we added earlier.
                //
                if (_domainUnload != null)
                {