Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Select Grid Row BY ID
Re: Select Grid Row BY ID [message #48030 is a reply to message #48029] Thu, 11 May 2017 20:57 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
It looks like a concurrency proeblem (a serialization issue) from here. But hard to say...
Are you running multiple worker threads? Is the method where your thread code resides executed more than once?
IF so, one thread may be altering the grid or SQL db (removing an entry and invalidating the iterators/indices), while the other one sleeps.
This can happen any time, right in the middle of your loop if you don't serializa access to shared data using mutexes.


Or it might be that the worker threads outlive the data objects (grid, or SQL).
For the sake of simplicity I'll give you a minimal example.
The following code MAY or MAY NOT lead to crash, for we can't be sure how long the thread will take to finish.


MyApp::MyMethod()
{

     String text; // String will be destroyed when when MyMethod returns(). 

     Thread().Run([=] {

        // Do someting that takes time.
        text = "hello world";          // This may or may not lead to crash. Because the thread may outlive the text object and MyMethod.   
     });



}



So you'll need to take into consideration all kinds of concurrency problems.

If you can provide a simple example (and a very small dummy database) reproducing the crash, I'll loook into it and try to help.

Regards,

Oblivion.




[Updated on: Thu, 11 May 2017 21:15]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Minor "mistake" in <CtrlLib/ArrayCtrl.h>
Next Topic: Insert Ctrl editors in a single row of ArrayCtrl
Goto Forum:
  


Current Time: Mon Apr 29 14:32:05 CEST 2024

Total time taken to generate the page: 0.02734 seconds