Questions tagged [detach]

303 questions
8
votes
2 answers

std::thread::detach causes crash after original caller is destroyed

struct Test { bool active{true}; void threadedUpdate() { std::this_thread::sleep_for(std::chrono::milliseconds(1)); if(!active) // crashes here after Test instance is destroyed return; } Test() { …
Vittorio Romeo
  • 90,666
  • 33
  • 258
  • 416
8
votes
2 answers

Writing a script to close screen session

I have a bunch of screen sessions running on my machine, but all of them are detached and unneeded. Is there a good way to just close all of them, so I have nothing when I type "screen -ls"?
user143879
  • 257
  • 3
  • 8
8
votes
2 answers

What is the difference between a detached thread and a daemon thread?

I understand that all daemon threads are detached threads, but why are all detached threads not daemon? Say thread "main" creates thread "A"(non-detached) and thread "A" creates thread "B"(detached). Can thread "A" exit while "B" continues…
sgowd
  • 946
  • 3
  • 10
  • 27
7
votes
1 answer

Cloning a Linq to Sql Entity - detaching data context

I have a requirement to clone a Linq to SQL entity. In overview: Customer origCustomer = db.Customers.SingleOrDefault(c => c.CustomerId == 5); Customer newCustomer = CloneUtils.Clone(origCustomer); newCustomer.CustomerId = 0; // Clear…
Neilski
  • 4,385
  • 5
  • 41
  • 74
7
votes
1 answer

Remove relationship between Eloquent records

I've created two classes extending Eloquent (contacts and tags), they have a ManyToMany relationship. I'm trying to create the method for un-tagging a contact, but am unable to find any documentation to tell how to remove the entry in the…
Shannon Phillips
  • 177
  • 2
  • 4
  • 13
7
votes
1 answer

Thread Detach / Joinable Methods

Where are the C# Thread Detach / Joinable functions? In C++ 11 these functions are available: thread::joinable() thread::detach() But they can't be found in .NET - where are they?
Joy Hyuk Lee
  • 756
  • 11
  • 22
6
votes
4 answers

How I can tell NHibernate to save only changed properties

I have class Person mapped to database with NHibernate. I load objects from DB and send it to different clients. First client will modify Name and Country property. Second client will modify only Name property. Then both returns modified objects to…
gagabu
  • 154
  • 1
  • 6
6
votes
1 answer

Error when detaching volume using hdiutil on OS X

Ive got a program that runs on Mac OS 10.5.8. The program runs a continuous cycle where it mounts an image, installs a browser plugin and unmounts the image again. If I leave this program running I eventually end up in a situation where I get the…
Bas Smit
  • 645
  • 1
  • 7
  • 19
6
votes
1 answer

How to attache detached entity in Doctrine?

I have a script which saves some new entities of type "A" in the loop to the database. But the loop can throw some exceptions which close entityManager. So it must be reopen. It causes that another entity of type "B" which should be joined with…
Čamo
  • 3,863
  • 13
  • 62
  • 114
6
votes
5 answers

Pythonic way to detach a process?

I'm running an etcd process, which stays active until you kill it. (It doesn't provide a daemon mode option.) I want to detach it so I can keep running more python. What I would do in the shell; etcd & next_cmd I'm using python's sh library, at the…
Alex Altair
  • 3,246
  • 3
  • 21
  • 37
6
votes
1 answer

Detaching a Fragment not triggering onSaveInstanceState()

My Android application has an ActionBar that changes which Fragment occupies a certain FrameLayout. I am trying to use onSaveInstanceState to save the state of a Fragment when the tab is changed, so that it can be recovered in onCreateView. The…
Dan
  • 1,198
  • 4
  • 17
  • 34
6
votes
1 answer

detached entity passed to persist

used: hibernate 3.6.10, maven 2, postgres 9. I have code that must work but it doesn't. before I used hibernate 3.6.2 and got really frustrated error: java.lang.ClassCastException: org.hibernate.action.DelayedPostInsertIdentifier cannot be cast to…
Dmitrii Borovoi
  • 2,814
  • 9
  • 32
  • 50
5
votes
3 answers

How can i update an entity object (detach) in EF CF?

I find out the solution: MyEntity tmp = ctx.Entities.Where(t => t.Id == objectWithNewValues.Id).SingleOrDefault(); if (tmp != null) { var entityInDb = ctx.Entry(tmp); entityInDb.CurrentValues.SetValues(objectWithNewValues); …
jojo
  • 13,583
  • 35
  • 90
  • 123
5
votes
0 answers

live streaming video goes black when there is no activity on the web-page

I am working on a website which has bunch of live streaming videos in it. After certain time(minutes) of inactivity in the browser, couple of live streaming videos goes black and have to refresh the page or scroll up/down in order to make it…
john
  • 11,311
  • 40
  • 131
  • 251
5
votes
0 answers

How can I know if the namespace of a package is imported by others?

This triggers a warning : library(tidyverse) library(glue) detach("package:glue", unload = TRUE) # Warning message: # l'espace de noms ‘glue’ ne peut être déchargé : # l'espace de noms ‘glue’ est importé par ‘tidyr’, ‘dplyr’ et ne peut, donc,…
moodymudskipper
  • 46,417
  • 11
  • 121
  • 167
1
2
3
20 21