Crash on closing DB due to cursor not nil

Steve Albin steve at steve-albin.com
Wed Apr 25 14:24:29 CDT 2007


I'm using RB2007r2 with V4RB 2.5.9.  I've come across a situation where my app crashes on shutdown if I don't set a cursor to nil first.  

Here is my code for the close event in my app class:
      
  self.CloseWindows    // close all windows that may be open
  if DBfile <> nil then   // DBfile is class VDatabase
    self.DBfile.Flush
    self.DBfile = nil
  end if 
  Valentina.ShutDown


This works fine unless I do one particular function in a global module where I declare a VCursor as global.  If I don't specifically set the VCursor to nil, the app crashes above where I set DBfile to nil.  

I have many VCursors declared in my windows, so I suppose the routine I use to close the windows solves this problem.  

I was under the impression that it was not necessary to set each cursor to nil before setting the DB to nil.  Has something changed or was I misinformed?  

If this is a bug, I will set up a project and report it.  But, I have a perfect workaround for my app.

Steve

-- 
Steve Albin - Montclair, NJ
http://www.jazzdiscography.com/
http://www.steve-albin.com/


More information about the Valentina mailing list