//
//  MPtrWrap.m
//  MySQLGUICommon
//
//  Created by Alfredo Kojima on Fri Jul 02 2004.
//  Copyright (c) 2004 MySQL AB. All rights reserved.
//

#import "MPtrWrap.h"


@implementation MPtrWrap

- (id)initWithPointer: (void*)ptr destroyer:(MPtrFree)destroyer
{
  self= [super init];
  if (self)
  {
    _pointer= ptr;
    _destroyer= destroyer;
  }
  return self;
}

- (void)dealloc
{
  if (_pointer && _destroyer)
    (*_destroyer)(_pointer);
}

- (void)setPointer:(void*)ptr
{
  _pointer= ptr;
}

- (void*)pointer
{
  return _pointer;
}


@end
