>>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
Lars> | Don't get me wrong: I think that having directly the layout Lars> pointer is | great. However, I am not sure how you fixed the Lars> problems. Lars> What problems? The problems with class switching. Is everything safe when one changes the class of a document? Cuts and pastes between documents with different classes? I remind you again than these were the reasons why you said at the time that using strings was the only safe way. Lars> | And I am not | sure that shared_ptr have any use here. Lars> sure it has... You cannot do it with references, bald pointers Lars> are way to fragile. Lars> | Normally, we delete lyxlayout | when the class is deleted. Lars> Now, with your boost magic, we can delete | the textclass, and Lars> some layouts will still be here, if we have a | leak. Lars> Yes, and we won't crash... Which is not always the best situation. I prefer a crash as soon as possible, rather than data loss due to incoherent pointers. Lars> | Is this really something we want? Lars> Yes... isn't it? Now it will even be easy to put in safegueards Lars> on the textclass, we can check if any of its layouts is in use Lars> before we delete it... This is getting more interesting. Do you plan to do it? Lars> | Lars> Perhaps not... eh yes. You are not allowed to keep a Lars> LyXLayout*, | Lars> or a LyXLayout&, both can be deleted under Lars> you and result in a | Lars> crash. >> Lars> | Could you give us a concrete scenario for this? [snip] I know that. I was asking about a concrete scenario in our use of _LyXLayout_. What I say is that basically they should be deleted when the textclass is deleted and that anything else is just crap. JMarc