Search Results

Search found 2 results on 1 pages for 'ajcaruana'.

Page 1/1 | 1 

  • How do I release an object allocated in a different AutoReleasePool ?

    - by ajcaruana
    Hi, I have a problem with the memory management in Objective-C. Say I have a method that allocates an object and stores the reference to this object as a member of the class. If I run through the same function a second time, I need to release this first object before creating a new one to replace it. Supposing that the first line of the function is: NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; This means that a different auto-release pool will be in place. The code to allocate the object is as follows: if (m_object != nil) [m_object release]; m_object = [[MyClass alloc] init]; [m_object retain]; The problem is that the program crashes when running the last line of the method: [pool release]; What am I doing wrong ? How can I fix this ? Regards Alan

    Read the article

  • How can I deny users to add/modify/remove printers to cups ?

    - by ajcaruana
    Hi, I am using Mac OS X 10.6. I wrote a program which will add and remove printers to a CUPS server using libcups. It works, but now I am considering the security aspects. This program takes a user name and password to authenticate on the CUPS server. Whatever user name and password I use, it works as long as it is valid on the system. How do I restrict access to only a specific user ? Regards Alan

    Read the article

1