Juce_string.cpp line 255 juce::string(cost juce::string& other) error An unhandled exception was thrown: read access violation. other was 0xFFFFFFFFFFFFFFFF

Hi, i’m new on the forum, i’ve this debug report to show the comunity. is generated by the juce_String class.
code that generate the error:

class FouTrasf : public juce::ThreadPoolJob
{
public:
JobStatus runJob()
{
// do stuff;
};
};

class MainComponent : public juce::audioAppComponent
{
FouTrasf* ft;
}

MainComponent::MainComponent()
{
ft->getJobName();
}

Some line on top the line JUCE_NATIVE_WCHAR definition is write to contact the support for assembly trouble.

class MainComponent : public juce::AudioAppComponent
{
FouTrasf* ft;
};

Do you initialise ft anywhere? If not, any access (e.g. calling getJobName) will dereference an invalid pointer, which is undefined behaviour.

Thanks to reply so fast :slight_smile: i’m new of c++ i was usefull of c# there weren’t pointers. i’ve to go a bit back, i think the problem is were i’m inizializing the FouTrasf class.

hi reduk, i inzialized the variable as you told me calling juce::ThreadPoolJob pooljob(const juce::String& name = “FouTraThread”); but the generated body called by the call runjob() tells me in italian that the function is not allowed beacose is a virtual function. I readed that virtual function are function with empty body but here not goes what thread has to do?

You’re returning an instance of ThreadPoolJob, which is abstract because of the pure-virtual member runJob.

You should probably return a (smart) pointer-to-ThreadPoolJob instead, and then return an instance of your type (FouTrasf) that derives from ThreadPoolJob.

But this part is generated by visual studio after inizialization i didn’t wrote it so make me a bit confused and more beacouse i didn’t find some tutorial about threadpool in juce