[Qt-interest] *** glibc detected *** ./program: double free or corruption (out): 0x08c9c938 ***
miroslav
miroslav at keytos.no
Wed Mar 25 11:25:46 CET 2009
Hi,
so here is my code - I am sending only the code that is related to this
issue (I think it should be enough - if not just let me know)
MainWindow:
//class definition
class VFST : public QMainWindow
{
Q_OBJECT
public:
VFST(QWidget *parent = 0);
~VFST();
signals:
void InitiateADICoordinates();
}
//here comes the declaration - signal/slot assignment
VFST::VFST(QWidget *parent) : QMainWindow(parent), ui(new Ui::VFSTClass)
{
ui->setupUi(this);
connect(this,SIGNAL(InitiateADICoordinates()), ui->ADI_plugin,
SLOT(InitiateCoordinateValues()));
emit InitiateADICoordinates();
}
Custom Widget plugin - LIB file (compiled to have a lib file):
//declaration
class adi : public QWidget
{
Q_OBJECT
public:
adi(QWidget *parent = 0);
public slots:
void InitiateCoordinateValues();
private:
GLfloat xCoord;
GLfloat yCoord;
GLfloat zCoord;
};
//and here comes the function
void adi::InitiateCoordinateValues()
{
xCoord = 90.0f;
yCoord = 90.0f;
zCoord = 90.0f;
}
as mentioned before I have tried to comment the assignment/initiating
values in the adi::InitiateCoordinateValues - so that the function is
completely empty and then I didn't get that error. I have also tried
with int, float - and the result was the same.....
On Wed, 2009-03-25 at 10:50 +0100, Thiago Macieira wrote:
> Em Quarta-feira 25 Março 2009, às 10:30:09, miroslav escreveu:
> > xCoord, yCoord, zCoord are also GLfloat..
> >
> > I don't get your point ("this syntax won't work anyway"). - the code I
> > attached is only to show the main definitions - of course I have all
> > this assignments in other files, classes.....etc
> >
> > all what I want is to send from a MainWindow a signal that the plugin
> > should initiate the GLfloat values,...
>
> Hello miroslav
>
> Unfortunately, your code doesn't show enough to allow us to determine what the
> problem is. Can you post a small, compilable example that shows the problem?
> Take your code and start removing things you don't need to produce the error.
> In the process of doing that, you may find what the issue is.
>
> The error message you got from glibc indicates that it was asked to free a
> memory address that isn't any memory block that it has allocated. I suggest
> running your application under valgrind to find out more: if it is a double
> free or if you're writing past the end of the block, valgrind will warn you
> and you will see what's wrong.
>
> Valgrind will not catch cases of corrupting pointers in valid memory addresses
> though.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090325/14a5c812/attachment.html
More information about the Qt-interest-old
mailing list