मैं this SO question से गुजर चुका हूं लेकिन इससे मदद नहीं मिली है।अमान्यऑपरेशन अपवाद - ऑब्जेक्ट वर्तमान में अन्यत्र उपयोग में है
यहां मामला अलग है। मैं पृष्ठभूमि कार्यकर्ताओं का उपयोग कर रहा हूँ। 1 BackgroundWorker उपयोगकर्ता की छवि इनपुट पर और अंदर firstbackgroundworker_runworkercompleted() मैं 3 अन्य backgroundworkers
algo1backgroundworker.RunWorkerAsync();
algo2backgroundworker.RunWorkerAsync();
algo3backgroundworker.RunWorkerAsync();
बुला उपयोग कर रहा हूँ काम कर शुरू होता है इस से प्रत्येक के लिए कोड है:
algo1backgroundworker_DoWork()
{
Image img = this.picturebox.Image;
imgclone = img.clone();
//operate on imgclone and output it
}
algo2backgroundworker_DoWork()
{
Image img = this.picturebox.Image;
imgclone = img.clone();
//operate on imgclone and output it
}
समान संचालन अन्य में किया जाता algo * backgrougrondworker_doWork()।
अब कुछ समय मुझे मिल रहा है "अवैधऑपरेशन अपवाद - ऑब्जेक्ट वर्तमान में कहीं और उपयोग में है"। यह बहुत मनमाना है। मुझे कभी-कभी यह algo1backgroundworker_DoWork में मिलता है और कभी-कभी algo2backgroundworker_DoWork में और कभी-कभी एप्लिकेशन में। Run (नया myWindowsForm());
मुझे क्या हो रहा है इसके बारे में कोई जानकारी नहीं है।