26

Re: How in the designer of object to refuse its creation?

AlekseySQL wrote:

it is passed...
The global event handler does not interrupt a performance thread in which there was a problem. If the program one-continuous generally happens nothing before flow clearing. In my case there is the main flow servicing worker threads, but to hope that it especially quickly fulfills it is not necessary.

Forgive, not so understood that you wanted to tell. Without insults, I while on your place  to write multi-threaded applications. These are servers SQL almost transparently provide a multiple user mode with a thread safety warranty - and there game rules the nobility it is necessary.

AlekseySQL wrote:

Where it is possible to read more in detail about all restrictions on usage of exceptions in Qt?

Above gave the reference on qt.io. But, and so common sense and such articles. At Sattera and Aleksandressku "coding Standards on With ++" (on storage) are section about boundary between units and why in between it is impossible to throw exceptions. Very similar on a current question.

27

Re: How in the designer of object to refuse its creation?

AlekseySQL wrote:

Now in exceptional situation I do such strange actions:

void MyLib:: SaveAndExit (const int i)
{
//error reports
if (i == 5) MyLib:: MessageError ("the Error: unsuccessful selection of storage!");
//here it is necessary to write the code of saving of the intermediate calculations
//global function invocation of end of operation
std:: terminate ();
}
void* MyLib:: AllocationMemory (const size_t Size)
{
void* Array = malloc (Size);
for (int i = 0; i <10 &&! Array; ++ i)
{
//we wait 1 second and we repeat attempt of selection of storage
QThread:: currentThread ()-> sleep (1);
Array = malloc (Size);
}
if (! Array)
{
try {int i = 5; throw i;}
catch (int i) {MyLib:: SaveAndExit (i);}
}
return Array;
}

It would be desirable instead of the unit:

try {int i = 5; throw i;}
catch (int i) {MyLib:: SaveAndExit (i);}

To write simply:

throw (int) 5;

Yes, the code crazy...

AlekseySQL wrote:

And still a question: attempt to wait and try to select storage once again is how much pertinent?

It is useless. Whence storage ?
It is possible to try to release something, and once again to try to select storage...
Though it is finite on 100 % depends on an operational environment (the compiler and an operating system)

28

Re: How in the designer of object to refuse its creation?

wrote:

cannot be true in any way. The object which has been never created remains live cannot.

I not absolutely correctly expressed. That is selected in the designer, it is necessary to live. Checked up saving this before throw from the designer, after an exception all given (members of a class of simple types) from  the designer were , i.e. the selected data disappear. Who was with the designer - will be deleted.

wrote:

On the future: there is such piece - the standard. Very much helps to clarify confidently as as should behave in language, without experimenting.

Thanks, but not in all compilers all always under the standard happens, and secondly, the knowledge of mechanisms in practice promotes the best understanding.