Jump to content


[v5111] access violations at end of program when using NxDbGrid


  • Please log in to reply
3 replies to this topic

#1 rond

rond
  • Members
  • 50 posts
  • Location:Lieshout, The Netherlands

Posted 21 February 2011 - 11:56 AM

I've been getting a lot of unexplained access violations which appear to trace their origin to the line containing FreeAndNil(FEditor) in the destructor for TNxCustomColumn.

One thing I noticed while debugging is that the inplace-editor I had assigned to that column got destroyed before the column itself.
It's as if having assigned an inplace-editor to the grid is enough to cause problems.

It might be important to know that I have all added columns design-time and that I am not relying on the 'auto-create'-column feature of the grid.
Also AlphaSkins-component is used to provide a skin.

I've had no luck in creating the same situation in a demo-program.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 6,685 posts
  • Gender:Male

Posted 21 February 2011 - 07:56 PM

Hello Rond,

Do you maybe accessing to InplaceEditor after column is destroyed?

First InplaceEditor is destroyed, and then Column (Since column have InplaceEditor).

If you can somehow create small demo project this will help.

Best regards
boki@bergsoft.net
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 rond

rond
  • Members
  • 50 posts
  • Location:Lieshout, The Netherlands

Posted 22 February 2011 - 11:14 AM

In the tests I've done so far it appears that simply destroying the frame is enough to cause this access violation.
I am not accessing the inplaceEditor in any part of my code as far as I know.

I did notice that the destructor for the edit-controls I am using got called before the grid itself was destroyed, so the columns couldn't destroy the editors even if they wanted to.

However the exception itself appears to be caused by the code trying to free the standard editor that is already assigned to one of the virtual-columns we're using.
Removing those columns from the grid appears to get rid of the error.

-- edit --
I didn't use Editor directly,  but I did notice I had referenced it during the construction of the columns in order to try and set autocomplete property.
As such I'm not sure why this could cause an access violation during destruction of the grids and why not every grid was affected in the same way (all three had virtual columns, only one appeared to cause the error).

#4 rond

rond
  • Members
  • 50 posts
  • Location:Lieshout, The Netherlands

Posted 25 February 2011 - 10:48 AM

I noticed a new access violation when trying to call MyGrid.BestFit(i, bfBoth).
The column just happened to be a TNxVirtualColumn.
As the NextDbGrid.Columns property only is supposed to have TNxDbCustomColumns there are going to be issues if the grid has one or more columns of TNxVirtualColumn.

I guess we do need a proper VirtualColumn (TNxDbVirtualColumn perhaps?) for use in NextDbGrids to solve this.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users